Simple redirect question?
Hi,
If I create a file called dir.txt in my home directory using the following redirect: ls -l > dir.txt and then run the following portion of my bash script, things go as planned. while read line do echo -e "Line = $line\n" done < dir.txt The following does NOT work: while read line do echo -e "Line = $line\n" done < `ls -l` If I try to redirect the 'ls -l' directly into my bash script I get an "ambiguous redirect" error. Could someone tell me why and what is the solution to this redirect problem. Thanks |
A Pipe almost works, but no End Of File?
while read line do echo -e "Line = $line\n" done | ls -l Almost there.... |
Quote:
Code:
ls -l | while read -r line |
Got It - You were right! Thanks
Working fine.
Thanks |
All times are GMT -5. The time now is 04:11 AM. |