[ale] shell scripting

Wandered Inn esoteric at denali.atlnet.com
Wed Nov 15 21:36:32 EST 2000


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

-- 
--
Until later: Geoffrey		esoteric at denali.atlnet.com

"Great spirits have always found violent opposition from mediocre minds. The
latter cannot understand it when a man does not thoughtlessly submit to
hereditary prejudices but honestly and courageously uses his intelligence."
- Albert Einstein

--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list