[Top][All Lists]

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

grep-2.5.1: broken egrep

From: Nelson H. F. Beebe
Subject: grep-2.5.1: broken egrep
Date: Thu, 4 Apr 2002 18:45:37 -0700 (MST)

Five days ago, I installed


on our local systems (16 UNIX flavors).

Since then, I've been getting failure notices from one of my cron jobs
with the error

        Usage: grep -hblcnsviw pattern file . . .

I've only just caught up enough on my backlog to track it down.

Here's the story:

In past grep releases, egrep and fgrep were symbolic (or hard) links
to grep.

However, in this new release, egrep and fgrep are shell scripts:

        % cat /usr/local/bin/egrep
        exec grep -E ${1+"$@"}

        % cat /usr/local/bin/fgrep
        exec grep -F ${1+"$@"}

Cron jobs normally run with a limited PATH, often just /bin:/usr/bin.
Even though my cron job explicitly invoked /usr/local/bin/egrep, that
script then runs /bin/grep, which is not the GNU version, and it does
not recognize the -E (or -F) option.

I'm patching these scripts locally so that the last line reads

        exec /usr/local/bin/grep -E ${1+"$@"}


        exec /usr/local/bin/grep -F ${1+"$@"}


It is imperative that future releases of GNU grep account for this:
those scripts should have

        exec $prefix/bin/grep ...

where $prefix is replaced at install time by the value in the

- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- Center for Scientific Computing       FAX: +1 801 585 1640, +1 801 581 4148 -
- University of Utah                    Internet e-mail: address@hidden  -
- Department of Mathematics, 110 LCB        address@hidden  address@hidden -
- 155 S 1400 E RM 233                       address@hidden                    -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe  -

reply via email to

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