GNU bug report logs - #19998
GREP_OPTIONS alternative?

Previous Next

Package: grep;

Reported by: Christian Kujau <lists <at> nerdbynature.de>

Date: Wed, 4 Mar 2015 07:09:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#19998: closed (GREP_OPTIONS alternative?)
Date: Wed, 11 Mar 2015 18:17:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 11 Mar 2015 11:15:59 -0700
with message-id <5500865F.3040102 <at> cs.ucla.edu>
and subject line Re: bug#19998: GREP_OPTIONS alternative?
has caused the debbugs.gnu.org bug report #19998,
regarding GREP_OPTIONS alternative?
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
19998: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19998
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Christian Kujau <lists <at> nerdbynature.de>
To: bug-grep <at> gnu.org
Subject: GREP_OPTIONS alternative?
Date: Tue, 3 Mar 2015 21:55:18 -0800 (PST)
Hi,

much to my dismay I noticed that GREP_OPTIONS has been made obsolete. I 
usually kept the following in my .profile:

  export GREP_OPTIONS='--color=tty --devices=skip'

which was honored by GNU/grep and BSD/grep and ignored by e.g 
SUNWcsu/grep. Without GREP_OPTIONS, I have to put something like this in 
my .profile:

if grep --version 2>/dev/null | egrep -q 'GNU|BSD' 2>/dev/null; then
        alias   grep='grep   --color=auto --devices=skip'
fi


But that leaves out all the other grep variants, so what I really have in 
my .profile now is something like this:

if grep --version 2>/dev/null | egrep -q 'GNU|BSD' 2>/dev/null; then
        alias   grep='grep   --color=auto --devices=skip'
        alias  egrep='egrep  --color=auto --devices=skip'
        alias  fgrep='fgrep  --color=auto --devices=skip'
        alias  zgrep='zgrep  --color=auto --devices=skip'
        alias bzgrep='bzgrep --color=auto --devices=skip'
        alias xzgrep='xzgrep --color=auto --devices=skip'
fi

(and even that leaves out bzegrep, xzfgrep, etc.)

I suspect that I'm doing it wrong - but what's the alternative to have 
some nice grep defaults and still be portable across platforms?

Thanks,
Christian.
-- 
BOFH excuse #355:

Boredom in the Kernel.


[Message part 3 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Christian Kujau <lists <at> nerdbynature.de>
Cc: 19998-done <at> debbugs.gnu.org
Subject: Re: bug#19998: GREP_OPTIONS alternative?
Date: Wed, 11 Mar 2015 11:15:59 -0700
[Message part 4 (text/plain, inline)]
On 03/05/2015 11:24 AM, Christian Kujau wrote:
> that (and the bits below) seem to confirm that there's no simple
> alternative to GREP_OPTIONS

I don't see why the script solution is not considered 'simple'. Anyway, 
it's worth documenting the script alternative, so I installed the 
attached into the manual and am marking the bug as done.
[0001-doc-give-a-script-wrapper-example.patch (text/x-patch, attachment)]

This bug report was last modified 10 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.