KORN: Looping through output of command
In bash, I normally use this to read each line of output:
while read line do echo $line done < <(cat /myfile.txt | cut -f1 -d" ") But this doesn't fly in KSH. I can't find the same thing on any tutorials, doesn't anyone know how to do this in Korn? |
Code:
#!/bin/ksh |
or with a closer syntax:
Code:
#!/bin/ksh |
Quote:
This method works perfectly. The other one that was posted kept giving me "% unclosed" errors. |
Quote:
Please double check, it works for me with both the real ksh and pdksh. You probably missed to copy the last line: "%" |
All times are GMT -5. The time now is 03:37 PM. |