[ale] bash programming question...

Christopher Bergeron christopher at bergeron.com
Wed Jul 18 14:00:31 EDT 2001


Does anyone know how I can [in bash] compare each line of a text file in a
while loop in bash?  For example:

a file bands.txt contains:
Nine Inch Nails
Stabbing Westward
Jimmy Buffet

my script, ticketmastergrepper.sh contains:
#!/bin/bash
wget -q -O /tmp/ticketbastard.txt http://www.ticketmaster.com
for i in 'cat bands.txt' do
  grep $i /tmp/ticketbastard.txt
  if [ $? -eq 0 ]
  then
    sendmail christopher at bergeron.com | echo "$i is onsale at ticketmaster!"
  fi
done


the problem I'm running into is with the spaces in the band names.  for
example when this runs, it greps for "Nine" instead of "Nine Inch Nails".

Any suggestions?





Christopher Bergeron
Systems Administrator
Full Line Distributors
(770) 416-4237
mis at fullline.com

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





More information about the Ale mailing list