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 12:54:05 -0400
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)

address@hidden (Bob Proulx) wrote:
> Using full hard coded paths is just a bad practice.

I disagree, but how's this for a compromise - look first in @bindir@,
and then in $PATH:

#!/bin/sh
grep=`PATH='@bindir@':$PATH which grep` || exit 2
case $grep in
  /*) exec "$grep" -E ${1+"$@"};;
  *) echo "$grep" >&2 && exit 2;;
esac

Or something similar.  (On NetBSD, "which" prints errors to stdout and
still exits 0.)


paul




reply via email to

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