[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-grep] egrep and fgrep script assume path
From: |
Stepan Kasal |
Subject: |
Re: [bug-grep] egrep and fgrep script assume path |
Date: |
Thu, 27 Jan 2005 13:03:47 +0100 |
User-agent: |
Mutt/1.4.1i |
Hello Paul,
On Wed, Jan 26, 2005 at 04:08:21PM -0800, Paul Eggert wrote:
> Please don't make the behavior of a utility depend on the name used
> to invoke it. It is useful sometimes to make a link to a utility
> with a different name, and that should not change what it does.
>
> <http://www.gnu.org/prep/standards/html_node/User-Interfaces.html>
>
> With the script as quoted above, one cannot make a link to (or copy
> of) egrep and expect it to work. For example, this common tactic
> won't work any more:
>
> mkdir $HOME/bin
> cp /usr/local/bin/egrep $HOME/bin
> export PATH=$HOME/bin:$PATH
> egrep foo bar
>
> as the result will be something like this:
>
> /home/eggert/bin/egrep: /home/eggert/bin/grep: No such file or directory
The user can easily guess that the fix is
cp /usr/local/bin/grep $HOME/bin
> Here is a patch.
..
> + echo 'exec '\''$(bindir)/grep'\'' $(OPTION_for_$@) $${1+"$$@"}' ) >$@
No, this is not acceptable to many people.
If you hardwire the path, you cannot do
mv /usr/local/bin/{,f,e}grep /usr/bin/
So in a sense you are again breaking the rule above. You cannot break any
single utility by moving it, but you suppose that grep is still at its original
place.
More importantly, you could not export the directory containing {,e,f}grep.
So please, let it be for now. I plan to introduce a configure time option
so that you can choose to install full binaries for [ef]grep. But I'd like
to put this off for 2.6.x.
After all, each bug report about problems with the egrep script is an
opportunity to teach people about grep -E ;-)
Have a nice day,
Stepan Kasal
- [bug-grep] egrep and fgrep script assume path, Joe Weening, 2005/01/26
- Re: [bug-grep] egrep and fgrep script assume path, Stepan Kasal, 2005/01/26
- Re: [bug-grep] egrep and fgrep script assume path, Paul Eggert, 2005/01/26
- Re: [bug-grep] egrep and fgrep script assume path, Paul Jarc, 2005/01/27
- Re: [bug-grep] egrep and fgrep script assume path, Stepan Kasal, 2005/01/26
- Re: [bug-grep] egrep and fgrep script assume path, Paul Jarc, 2005/01/27
- Re: [bug-grep] egrep and fgrep script assume path, Stepan Kasal, 2005/01/27
- Re: [bug-grep] egrep and fgrep script assume path, Paul Jarc, 2005/01/27
- Re: [bug-grep] egrep and fgrep script assume path, Stepan Kasal, 2005/01/27
- Re: [bug-grep] egrep and fgrep script assume path, Paul Jarc, 2005/01/27
- Re: [bug-grep] egrep and fgrep script assume path, Stepan Kasal, 2005/01/27