Re: Boolean Grep?
Article: 7790 of alt.hackers From: davef@glenatl.glenayre.com (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: 3oogct$i59@babylon5.glenqcy.glenayre.com Reply-To: davef@glenatl.glenayre.com NNTP-Posting-Host: phoenix.glenatl.glenayre.com X-Newsreader: TIN [version 1.2 PL2] Status: RO
David A. Wagner (dawagner@princeton.edu) wrote: : In article <3oisj9$vp1@hopi.gate.net>, : Thomas Davis <tdavis@news.gate.net> wrote: : > : > #!/bin/csh : > set value = `grep $argv[1] $argv[2]`; : > 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.