bug-grep
[Top][All Lists]
Advanced

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

Re: grep-2.5.1a egrep/fgrep PATH problem


From: Charles Levert
Subject: Re: grep-2.5.1a egrep/fgrep PATH problem
Date: Thu, 23 Jun 2005 02:13:59 -0400
User-agent: Mutt/1.4.1i

* On Wednesday 2005-06-22 at 20:57:22 +0100, Chris Hughes wrote:
> 
> Hiya,

Ahoy!


>  The egrep/fgrep wrappers assume that grep-2.5.1a is the first grep on the 
> user's PATH:
> 
> #!/bin/sh
> exec grep -E ${1+"$@"}
> 
>  So if I install into in /usr/gnu/  (on Solaris for example) and run 
> /usr/gnu/bin/fgrep then it's possible that it will end up running 
> /usr/bin/grep.
> 
>  Perhaps this wrapper should hardcode in the GNU 2.5.1a grep binary, or 
> run grep from the same directory?

I've seen this issue discussed before on
the list.

Of course, the first thing to say is that these
days users should try to get in the habit of
using "grep -E" and "grep -F" directly.

However, I tend to agree with you for the
compatibility script.

What do others on the list think?

For reference, several distributors of GNU grep
patch it to achieve just that:

   -- NetBSD
      
<http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/textproc/grep/patches/patch-aa?annotate=1.3>

   -- OpenPKG
      <http://cvs.openpkg.org/getfile/openpkg-src/grep/grep.patch?v=1.1.2.1>

   -- SuSE Linux
      <ftp://ftp.suse.com/pub/suse/i386/9.3/suse/src/grep-2.5.1a-4.src.rpm>
         grep-2.5.1a.diff
                
so maybe we should as well.

The other approach is to use symlinks to the
grep binary

   -- Gentoo Linux
      
<http://www.gentoo.org/cgi-bin/viewcvs.cgi/sys-apps/grep/grep-2.5.1-r8.ebuild?annotate=1.2>

   -- Fedora Core/Red Hat Linux
      <http://cvs.fedora.redhat.com/viewcvs/devel/grep/grep.spec?annotate=1.50>

but this goes against the GNU coding standards:

   <http://www.gnu.org/prep/standards/standards.html#User-Interfaces>.




reply via email to

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