Jan 27, 2007 #1 Yarka Technical User Joined Jan 14, 2007 Messages 192 Location ES i've script as: cat $1 | while read LINE; do until [ "$a" -eq 1 ]; do ... read LINE ... done read LINE until [ "$b" -eq 1 ]; do ... read LINE ... read LINE ... done done how i can indicate end of file in the conditions of until? thanks.
i've script as: cat $1 | while read LINE; do until [ "$a" -eq 1 ]; do ... read LINE ... done read LINE until [ "$b" -eq 1 ]; do ... read LINE ... read LINE ... done done how i can indicate end of file in the conditions of until? thanks.
Jan 29, 2007 #2 columb IS-IT--Management Joined Feb 5, 2004 Messages 1,231 Location EU Something along the lines of Code: until ! read line do until [ $a -eq 1 ] do ... done until [ $b -eq 1 ] do ... done done < $1 Ceci n'est pas une signature Columb Healy Upvote 0 Downvote
Something along the lines of Code: until ! read line do until [ $a -eq 1 ] do ... done until [ $b -eq 1 ] do ... done done < $1 Ceci n'est pas une signature Columb Healy
Jan 29, 2007 #3 columb IS-IT--Management Joined Feb 5, 2004 Messages 1,231 Location EU Hmm I think I see what you mean this time In pseudo code Code: while more file to read do ... until $a equals 1 OR end of file do ... done until $b equals 1 OR end of file do ... done ... done How about Code: while read line do ... while read line do ... ... [[ $a -eq 1 ]] && break done while read line do ... ... [[ $b -eq 1 ]] && break done ... done There will still be some issues at the boundaries which you will have to watch closely but Ceci n'est pas une signature Columb Healy Upvote 0 Downvote
Hmm I think I see what you mean this time In pseudo code Code: while more file to read do ... until $a equals 1 OR end of file do ... done until $b equals 1 OR end of file do ... done ... done How about Code: while read line do ... while read line do ... ... [[ $a -eq 1 ]] && break done while read line do ... ... [[ $b -eq 1 ]] && break done ... done There will still be some issues at the boundaries which you will have to watch closely but Ceci n'est pas une signature Columb Healy