[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem with egrep and fgrep
From: |
Eli Zaretskii |
Subject: |
Re: problem with egrep and fgrep |
Date: |
Mon, 13 Sep 2004 23:02:00 +0300 |
> Date: Mon, 13 Sep 2004 13:48:10 -0600
> From: address@hidden (Bob Proulx)
>
> 'which'! That opens another Pandora's box of problems.
Agreed.
> In it the following is suggested as the best method to find a command
> on PATH.
>
> pathfind() {
> OLDIFS="$IFS"
> IFS=:
> for p in $PATH; do
> if [ -x "$p/$*" ]; then
> IFS="$OLDIFS"
> return 0
> fi
> done
> IFS="$OLDIFS"
> return 1
> }
>
> > case $grep in
> > /*) exec "$grep" -E ${1+"$@"};;
> > *) echo "$grep" >&2 && exit 2;;
> > esac
>
> 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.
Is this really worth the hassle? I think it's much easier to just
have another binary called fgrep, and be done with that. What's
another 250KB on today's huge disks? I think the time all of you
invested into this discussion costs much more than the dollar
equivalent of 250KB.
- Re: problem with egrep and fgrep, (continued)
- Message not available
- Message not available
- Re: problem with egrep and fgrep, Ralph Corderoy, 2004/09/02
- Re: problem with egrep and fgrep, Bob Proulx, 2004/09/03
- Message not available
- Re: problem with egrep and fgrep, Ralph Corderoy, 2004/09/07
- Re: problem with egrep and fgrep, Bob Proulx, 2004/09/12
- Re: problem with egrep and fgrep, Paul Jarc, 2004/09/13
- Re: problem with egrep and fgrep, Bob Proulx, 2004/09/13
- Re: problem with egrep and fgrep, Paul Jarc, 2004/09/13
- Re: problem with egrep and fgrep,
Eli Zaretskii <=
- Message not available
- Re: problem with egrep and fgrep, Eric Backus, 2004/09/13
- Re: problem with egrep and fgrep, Bob Proulx, 2004/09/15
- Message not available
- Re: problem with egrep and fgrep, Eric Backus, 2004/09/15
Re: problem with egrep and fgrep, Bob Proulx, 2004/09/12