On Fri, Dec 13, 2002 at 05:31:35PM -0700, Scott Wiersdorf wrote:
> FWPers,
> 
> Pretending your machine did not have e?grep, how concisely could you
> duplicate the GNUish "-q" (silent) functionality: stop scanning on
> first match and exit(0). If no match, exit(1).
> 
> Extra Credit:
> 
> - is there a short way to do it without slurping the whole file?

perl -n
/pattern/ && exit 1; END { exit !$? }

Scott
-- 
Scott Wiersdorf
[EMAIL PROTECTED]

Reply via email to