bug-grep
[Top][All Lists]
Advanced

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

[bug-grep] egrep and fgrep script assume path


From: Joe Weening
Subject: [bug-grep] egrep and fgrep script assume path
Date: Tue, 25 Jan 2005 13:19:01 -0800 (PST)

Using GNU grep 2.5.1 on an x86 Solaris 9 system, the "egrep" and
"fgrep" commands are scripts:

#!/bin/sh
exec grep -E ${1+"$@"}

#!/bin/sh
exec grep -F ${1+"$@"}

This makes the assumption that the shell will find GNU grep in its
path.  In our case, GNU grep is installed in /usr/local/gnu/bin.
If this directory is not in the path, and someone explicitly runs
/usr/local/gnu/bin/egrep, then the script runs /usr/bin/grep which
does not understand the -E and -F options.

A fix would be to hardcode the path to GNU grep in the scripts.

                                Joe Weening
                                IDA/CCR




reply via email to

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