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

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

Re: problem with egrep and fgrep


From: Paul Jarc
Subject: Re: problem with egrep and fgrep
Date: Mon, 13 Sep 2004 16:00:46 -0400
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)

address@hidden (Bob Proulx) wrote:
> In it the following is suggested as the best method to find a command
> on PATH.

That's useful, thanks.

> Since 'grep' has no subprocesses it would seem simpler, if that is
> what you want to do, to just to set PATH to '@bindir@':$PATH and then
> execute grep without trying to locate it first.

Works for me.  Or, if anyone cares about touching the environment,
it's easy enough to check a single directory:

#!/bin/sh
if test -x '@bindir@'/grep
  then exec '@bindir@'/grep -E ${1+"$@"}
  else exec grep -E ${1+"$@"}
fi


paul




reply via email to

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