You shouldn't rely on cat or for to read a file line by line, but instead do this:
while read line; do
commands
done < hosts
while read line; do
commands
done < hosts
Matthew Mosesohn
"Мир тесен."
"Мир тесен."
From: "Hiisi" <hiisi@xxxxxxxxxxxxxxxxx>
To: "Community support for Fedora users" <users@xxxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, January 16, 2012 12:08:45 PM
Subject: Re: OT: bash script - unexpected exit
Never mind. I changed it to use for line in `cat hosts` and now it works.
Sorry for the noise, list. Thanks for the tip, Kevin. That was fast!
To: "Community support for Fedora users" <users@xxxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, January 16, 2012 12:08:45 PM
Subject: Re: OT: bash script - unexpected exit
Never mind. I changed it to use for line in `cat hosts` and now it works.
Sorry for the noise, list. Thanks for the tip, Kevin. That was fast!
-- users mailing list users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org