Re: grep trick
On 09/04/2008, Chris Bannister <mockingbird@earthlight.co.nz> wrote:
> On Tue, Apr 08, 2008 at 10:22:08AM +1000, Rich Healey wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Mike Bird wrote:
> > > On Mon April 7 2008 16:03:28 Chris Bannister wrote:
> > >> export GREP_COLOR=33
> > >> alias grep='grep --colour=always'
> > >
> > > This will break any scripts which assume that the output
> > > of grep has not been annotated with color escape sequences.
> > >
> > > --Mike Bird
> > >
> > >
> > Those scripts will not load his .bashrc
>
>
> Which ones? e.g ... as me:
>
> echo $GREP_COLOR
> 33
>
> less gtt
> #!/bin/bash
>
> echo $GREP_COLOR
>
> ./gtt
> 33
>
> So any scripts run *as* me get it too.
More precicely, any scripts you run from interactive sessions (terminal etc).
Scripts started under your UID from cron, at, etc, will not get the
GREP_COLOR var.
Reply to: