[Top][All Lists]

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

Re: problem with egrep and fgrep

From: Eric Backus
Subject: Re: problem with egrep and fgrep
Date: Wed, 15 Sep 2004 12:13:11 -0700

"Bob Proulx" <address@hidden> wrote in message news:address@hidden
Eric Backus wrote:
Frankly, I'd like to see this done with links, in spite of the coding

The problem is how do you handle renames with a prefix or suffix?
Let's say you configure --prefix="gnu" so the final binary ends up
being called 'gnuegrep'.  Will it still recognize that this implies
the -E option?

Another case is someone who compiles GNU grep and creates 'egrep'.
Then they run into a system where they cannot adjust PATH.  So on that
system they copy 'egrep' and call it 'gnuegrep'.  Now on that system
will this 'gnuegrep' recognize that this implies the -E option?

I'd make the name-handling code look for a substring "egrep" somewhere in the basename of $0 to mean that -E should be used, a substring "fgrep" means that -F should be used, else treat it as normal grep. Ideally the substring comparison should be case-insensitive. Perhaps it's not 100% foolproof, but I'm having trouble coming up with a realistic failure mode.

If not links, then we should just go to completely separate copies.

That would be my choice too, but preferably only on non-GNU systems
where GNU software has been installed as an add-on.  On a native GNU
system these are not problems and there is no need to work around

I'm not convinced that making the code (and install) work differently depending on system type is a good idea. But I guess I don't care very much as long as any systems I have access to work properly.

Eric Backus

reply via email to

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