Re: Boolean Grep?
Article: 7821 of alt.hackers From: firstname.lastname@example.org (Peter Seebach) Newsgroups: alt.hackers Subject: Re: Boolean Grep? Date: 15 May 1995 10:13:48 -0500 Organization: Solutions Online Lines: 32 Approved: email@example.com Message-ID: firstname.lastname@example.org NNTP-Posting-Host: solutions.solon.com Status: RO
In article <email@example.com>, 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 - firstname.lastname@example.org -- email@example.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.