vairables within a subshell lose their scope. you can rewrite your script w/o the while and pipe like this: ---------------------------------- list="word1 word2" for NAME in $list do echo $NAME VAR=2 # this seems to be a local variable within the while loop done ----------------------------------- and that should work _______________________________________________________________________ This mailing list is neither sponsored nor endorsed by Invensys Process Systems (formerly The Foxboro Company). Use the info you obtain here at your own risks. Read http://www.thecassandraproject.org/disclaimer.html foxboro mailing list: //www.freelists.org/list/foxboro to subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join to unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave