[Top][All Lists]

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

problem with egrep and fgrep

From: Warren L Dodge
Subject: problem with egrep and fgrep
Date: Tue, 31 Aug 2004 10:40:22 -0700 (PDT)

I just ran into a problem where I was getting unsupported switch errors when
using gnu egrep.

I tracked it down to the contents of the egrep and fgrep files.

cat egrep 
exec grep -E ${1+"$@"}

cat fgrep
exec grep -F ${1+"$@"}

These two commands (egrep,fgrep) exec grep with switches to get the
functionality needed.

The problem is they do not specify the directory of the grep command. So in
my case it was using solaris8 /bin/grep instead of the grep which is in the
same directory as the egrep I specified on the command line.

This account I was using does not have the gnu tools in the PATH. However, it
runs scripts which use the gnu tools. I believe in the past this has
worked. I think the egrep and fgrep were links to grep rather then a small

It seems that the script should use $0 to calculate the path for grep.

reply via email to

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