bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep: default file if -r is used


From: Thomas Schwinge
Subject: Re: grep: default file if -r is used
Date: Fri, 11 Jun 2004 20:13:14 +0200
User-agent: Mutt/1.4.2.1i

On Fri, Jun 11, 2004 at 03:57:29PM +0200, Koblinger Egmont wrote:
> On Fri, 11 Jun 2004, Paul Jarc wrote:
> 
> > FWIW, I'd prefer -R or a new option.  (Even then, I'm not really happy
> > with the fact that $GREP_OPTIONS could break a script.  But I suppose
> > it can already break scripts in different ways.)
> 
> Sure it can... show me a script that always behaves correctly, no matter
> how I set LANG, LC_*, SHELL, SHELLOPTS, IFS, USER, HOME, _POSIXLY_CORRECT,
> _POSIX2_VERSION and a bunch of other variables... it's kind of impossible.
> Scripts always assume that you have a reasonable set of env vars.

#v+
#!/bin/sh

if [ x"$cleared_env_" != xy ]; then
  exec \
  env -i cleared_env_=y \
  "$0" ${1+"$@"}
fi

[SCRIPT]
#v-

That should catch most of them...
;-)


Regards,
 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]