Sam Trenholme's webpage
This article was posted to the Usenet group alt.hackers in 1995; any technical information is probably outdated.

Re: Boolean Grep?

Article: 7790 of alt.hackers
From: (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$
X-Newsreader: TIN [version 1.2 PL2]
Status: RO

David A. Wagner ( wrote:
: In article <3oisj9$>,
: Thomas Davis <> 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` ]
      echo "It's in there!"
      echo "Nope, it's not there"

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.

Parent Parent

Back to index