Re: Boolean Grep?
Article: 7790 of alt.hackers From: firstname.lastname@example.org (Dave Frascone) Newsgroups: alt.hackers Subject: Re: Boolean Grep? Date: 9 May 1995 19:39:09 GMT Organization: Glenayre Electronics, Inc. Lines: 38 Approved: by my loving self Message-ID: email@example.com Reply-To: firstname.lastname@example.org NNTP-Posting-Host: phoenix.glenatl.glenayre.com X-Newsreader: TIN [version 1.2 PL2] Status: RO
David A. Wagner (email@example.com) wrote: : In article <firstname.lastname@example.org>, : Thomas Davis <email@example.com> wrote: : > : > #!/bin/csh : > set value = `grep $argv $argv`; : > if( $#value > 0 ) then : > echo "True" : > else : > echo "False" : > : Ack!! That's disgusting. Didn't your parents teach you not to use : csh in public? Try /bin/sh instead: : grep pattern file1 file2 file3 > /dev/null && echo true : Anyhow, you really should read csh.whynot someday, for kicks. :-) I have not tried this, but in ksh, wouldn't the `test` work: if [ `grep command >/dev/null` ] then echo "It's in there!" else echo "Nope, it's not there" fi Anyway, now I have to come up with an obhack: Hmmm can't think of anything, so a really lame hack. I had lots of noise coming off of my bass amp, and computer speakers. I assumed that our house was poorly grounded. So, I took a 6' stake and ran it into the ground, ran the wire inside, and wired every piece of audio equipment in my house. Buzzing noise was gone... I told you it was lame.