[SWLUG] grep question
bascule
excession at bigfoot.com
Tue Feb 12 12:58:55 UTC 2002
ho ho! just give me a week or two to follow this:-)
On Tuesday 12 February 2002 12:05 pm, you wrote:
> My 2p worth ...
>
> #!/bin/sh
>
>
> barf() { stat=$1; shift; echo "$*" >&2; exit $stat; }
>
> pause=
>
> fi
> done < "$patternfile"
----snip----
> which doesn't involve all the rereading the pattern file every time etc.,
> and works for multiple files to be searched and stops if grep dies
> for strange reasons (bogus patterns etc.)
>
> For extra brownie points,
> indent the grep output to make it more readable and/or
> make the error messages more visible and/or
> count the matches!!
>
bascule
--
"You're very sure of your facts, " he said at last, "I
couldn't trust the thinking of a man who takes the Universe
- if there is one - for granted. "
More information about the Swlug
mailing list