Date: Mon, 1 Sep 2014 15:38:13 -0600 (MDT) From: Warren Block <wblock@wonkity.com> To: David Benfell <benfell@parts-unknown.org> Cc: freebsd-questions@freebsd.org Subject: Re: controlled environment for regular expressions? Message-ID: <alpine.BSF.2.11.1409011536560.82026@wonkity.com> In-Reply-To: <20140901204147.GA53086@home.parts-unknown.org> References: <20140901204147.GA53086@home.parts-unknown.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 1 Sep 2014, David Benfell wrote: > Hi all, > > I am having a major problem with regular expression matching returning > different results when run from a script under cron or as a delivery > instruction from postfix rather than from the command line. > > I don't even know how to debug this. These are all in scripts and > delivery instructions that I have had working for over a decade. And > when I run them from the command line, they work as expected. > > The path for seeking executables should not be at issue. I use the > PATH variable in my crontabs and set it to the same PATH as at a > terminal. > > I have encountered this problem with both grep and GNU sed (gsed, from > the port). > > This is all stuff that worked until recently, and worked for years > under Linux. The only change I think I've made is to implement an IPv6 > tunnel. I hope, really hope, I can safely say that's irrelevant. > > I use zsh, also a choice that's over a decade old, for both my command > line and to run scripts. > > I've never liked regular expressions. I think they are an awful > kludge. But unfortunately, a major part of my workflow depends on them > working correctly and *predictably*. > > Has anyone else encountered problems with this? How do you fix it? An example would be useful. My first guess is that the regexes are working, but some invisible whitespace like carriage returns has snuck into the values.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.11.1409011536560.82026>