Re: grep trick
On Mon, Apr 07, 2008 at 10:58:43PM -0400, Kamaraju S Kusumanchi wrote:
> Rich Healey wrote:
>
> > 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.
> >>
> > Those scripts will not load his .bashrc
>
> The GREP_OPTIONS and GREP_COLOR environment variables created some problems
> for me a while ago (See
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411931 )
>
> So instead of aliasing grep with color related options, I am currently using
>
> if [ ! -z "$PS1" ]; then
> function colgrep(){ command grep --color=always "$@"; }
> fi
>
> hth
> raju
At least in unstable:
"grep --color=auto" works nicely. So I think we can alias or use
GREP_OPTIONS='--color=auto'; export GREP_OPTIONS
Also, "GREP_COLORS" should be used instead of "GREP_COLOR".
Anyway, it was interesting.
Osamu
> Kamaraju S Kusumanchi
> http://www.people.cornell.edu/pages/kk288/
> http://malayamaarutham.blogspot.com/
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>
Reply to: