2009/9/19 Rodolfo Martínez <[email protected]>: > 'while' continues until read fails, there is a 3rd 'read' (when it > fails) that clears 'f' > [mar...@amartir01 ~]$ set -x ; echo -n "foo|bar" | awk 'BEGIN{RS="|"}{ > print $1 }' | while read s; do f=$s ; echo "f=$f" ; done ; echo "f=$f" > + set -x > + awk 'BEGIN{RS="|"}{ print $1 }' > + read s <== First read > + echo -n 'foo|bar' > + f=foo > + echo f=foo > f=foo > + read s <== Second read > + f=bar > + echo f=bar > f=bar > + read s <== Third read, the one that clears 'f' > + echo f= > f= > ++ echo -ne '\033]0;mar...@amartir01:~'
Yep, however, he is concerned with the variable 'f' being blank, not 's'. - Gonzalo -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
