Looping using while read line, using a variable instead of a file.
I created the following.
x="top
middle
bottom"
I would like to make the following work.
while read line
do
echo $line
done
instead of importing a file I would like to use the variable $x I tried using pipes, but with no luck. My goal is to read one line at a time, but not have to export my data to another file, I would like to keep it all within one script.
Please help.
Last edited by henrtm05; 09-24-2010 at 05:08 PM.
|