Re: Boolean Grep?
Article: 7821 of alt.hackers From: seebs@solutions.solon.com (Peter Seebach) Newsgroups: alt.hackers Subject: Re: Boolean Grep? Date: 15 May 1995 10:13:48 -0500 Organization: Solutions Online Lines: 32 Approved: clc-request@solutions.solon.com Message-ID: 3p7r3c$7r9@solutions.solon.com NNTP-Posting-Host: solutions.solon.com Status: RO
In article <3oqqi6$f5e@sue.cc.uregina.ca>, Bruce Guenter <guentbru@HERCULES.CS.UREGINA.CA> wrote: >>Ack!! That's disgusting. Didn't your parents teach you not to use >>csh in public? Try /bin/sh instead: >Amen! Or even better, /bin/bash (or /bin/ksh if all else fails) sh over ksh over bash, for simple scripts. Otherwise, ksh over bash over sh. But sh wins big over bash; it's small, fast, and clean. bash is laden with bogosities. ksh is cleaner. rc is the correct solution, of course. >>grep pattern file1 file2 file3 > /dev/null && echo true >I just don't get it. Why send output to /dev/null when *grep has an >option to make it silent: >grep -s pattern file1 file2 file3 && echo true At Least One Grep has no '-s' option. ObHack: A program which checks the return status of commands and returns 'true' or 'false'. It almost works. It probably would have worked had I not been using hp-ux. -s -- Peter Seebach - seebs@solutions.solon.com -- seebs@intran.xerox.com C/Unix proto-wizard -- C/Unix questions? Send mail for help. Moderator - alt.religion.kibology, comp.lang.c.moderated Copyright 1995 Peter Seebach. Not for distribution through Microsoft Network.