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

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

Re: man grep


From: Bob Proulx
Subject: Re: man grep
Date: Tue, 5 Feb 2008 10:20:07 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

Eric Blake wrote:
> According to Wim Sturkenboom on 2/4/2008 10:02 PM:
> | the man pages state that egrep is the same as grep -e. I however can't
> | figure out how unless -e is the default behaviour of grep.
> | On the above slackware box, /usr/bin/egrep is a link to /bin/egrep which
> | in turn is a link to /bin/grep. Nowhere the -e option comes into play.
> | Is -e indeed the default behaviour or do I miss something?
> 
> You missed the fact that argv[0] recalls the name of the binary being
> executed.  In other words, grep violates GNU Coding standards (which say
> that a binary should behave independently of the name it was called by) in
> order to implicitly turn on -e if invoked by the name 'egrep'.

Of course you mean 'grep -E'.  'grep -e' is something different.
'egrep' and 'grep -E' are intended to produce the same behavior of
using extended regular expressions.  'egrep' is the old way.  Using
'grep -E' is the preferred method these days since all of the behavior
has been rolled into the 'grep' binary.

Bob




reply via email to

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