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. |
Try a here string.
http://www.tldp.org/LDP/abs/html/x17471.html Code:
while read line |
Quote:
|
Please mark as SOLVED once you have a solution.
|
All times are GMT -5. The time now is 05:04 AM. |