clone 404635 -1 reassign -1 grep retitle -1 grep: GREP_OPTIONS allows a user to break unrelated shell scripts thanks
To the grep maintainer: please see the BTS entry for this bug: essentially, by using an invasive setting for GREP_OPTIONS, grep now breaks for this user when it is used in shell scripts. I suggest that either GREP_OPTIONS is only used when the output is a tty, or that it is disabled altogether, or that there is a big fat health warning in the manpage about its use. On Wed, Feb 21, 2007 at 07:00:57PM +0000, Adam D. Barratt wrote: > tags 404635 + patch > thanks > > Hi, > > On Thu, 2006-12-28 at 12:53 +0000, Julian Gilbey wrote: > > On Wed, Dec 27, 2006 at 05:27:19PM -0500, Kamaraju Kusumanchi wrote: > > > A little more debugging, I found that the culprit is either of > > > GREP_OPTIONS, > > > GREP_COLOR environment variables. Both these options are documented in > > > the man > > > page of grep. On my machine I have > > > > Ah, that would do it. Hmm. Will have to tell grep to ignore this > > stuff. I'm surprised that nothing else breaks for you! > > Trivial as it is :-), please find attached a patch resolving this issue. > > Regards, > > Adam I don't believe this is a devscripts issue. Either grep is at fault for allowing users to set environment variables which drastically affect its behaviour, or the user is at fault for (ab)using this option. It is clear to me that many other pieces of software, which expect standard behaviour from grep, will similarly break with this option. I don't think that fixing every occurrence of grep in every shell script in Debian (which may turn out to be necessary to correctly fix this) is the correct way to go. Julian > --- devscripts-2.9.27.orig/who-uploads.sh 2006-11-06 14:05:49.000000000 > +0000 > +++ devscripts-2.9.27/who-uploads.sh 2007-02-20 20:53:57.000000000 +0000 > @@ -88,7 +88,7 @@ > [ -r $file ] && . $file > done > > - set | grep "^WHOUPLOADS_") > + set | GREP_OPTIONS= grep "^WHOUPLOADS_") > > # check sanity > if [ "$WHOUPLOADS_MAXUPLOADS" != \ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]