[ale] shell scripting
Ken Nagorski
kenn at pcintelligent.com
Thu Nov 16 01:50:01 EST 2000
Sure,
grep prints it if you find it. I wanted the ones grep didn't
find. That is why I was using the echo, if you don't find a match let me
know.
Thanks
Ken
On Wed, 15 Nov 2000, Wandered Inn wrote:
> Ken Nagorski wrote:
>
> > Hi,
> >
> > Anyone know how to say if this is in this file don't do anything
> > else print it our? Does that make sense? I know I have done this before
> > with a shell script but I can't get it to work now. Here is the script
> > it is not working however...
> > i am trying to use the exit status but that doesn't seem to be
> > right.
> >
> > Thank you
> > Ken
> > -----------snip------------------------------
> >
> > #!/bin/bash
> >
> > for d in `less domains`
> > do
> > `grep $d shared-ips`
> > if [ $?==127 ]
> > then
> > echo "$d"
> > fi
> > done
>
> Unless I misunderstood the question, I think you're making it harder
> than it really is:
>
> for rec in $(<domains); do
>
> # note, grep will print it if you find it, so you don't need the echo
> statement you have above
>
> grep $rec shared-ips
>
> done
>
>
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
More information about the Ale
mailing list