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

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

Re: [grep-2.5] Option '--program-prefix=g' behaves incorrect


From: Paul Eggert
Subject: Re: [grep-2.5] Option '--program-prefix=g' behaves incorrect
Date: Wed, 29 May 2002 14:11:44 -0700 (PDT)

> From: address@hidden (Stepan Kasal)
> Date: Wed, 29 May 2002 09:12:05 +0000 (UTC)

> (BTW: I don't understand why simple "$@" is not enough.)

Because many shells (e.g. Solaris 8 /bin/sh) mishandle "$@" when there
are zero arguments.

> In this case, similarily as with the previous one, we have to change "grep"
> to "ggrep" and perhaps rename "egrep" to "gegrep" and "fgrep" to "gfgrep."

You can find a patch to do this in:
http://mail.gnu.org/pipermail/bug-gnu-utils/2002-May/000474.html

> 2) So we can write a fixed path to the script during the install phase.
> But this means that such "executable" cannot be moved or exported via nfs.

It can be exported via NFS; I do that regularly.  All you have to do
is make sure that the same path works on all hosts.  This is a good
idea anyway, for sanity's sake.

Also, the script can be moved without any problem.  The real problem
is that the underlying executable can't be moved.  Unfortunately this
sort of problem is quite common.  It occurs all the time with shared
libraries, for example; it's not limited to scripts.

> 3) We can deduce the path from $0.

Not portably.  There is no requirement that $0 contain the original
path name.  It need not even contain the original base name.

> what about dropping the egrep and fgrep support completely?

I don't think that would be wise.  POSIX 1003.1-1992 requires egrep
and fgrep, and many older scripts assume them.  egrep and fgrep have
been removed from POSIX 1003.1-2001, but it's way too early to drop
support for them.



reply via email to

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