How can you process a file line by line in ksh?

link|improve this question

50% accept rate
feedback

2 Answers

up vote 3 down vote accepted

somthing like:

while read LINEVAR ; do echo ${LINEVAR} ; done < myfile.txt

which will read one line of input from myfile.txt at a time?

link|improve this answer
Just a word of warning -- without double quotes around it, many spaces (or whatever IFS is set to) will be reduced to one space. Nulls always vanish in shells script output. Not that we need nulls for anything. But they are useful for some reason in binary files. – chris May 17 '10 at 14:24
feedback

Check bellow link, I have posted 5 different methods with timing comparison.

Different ways to process a file line by line in a shell script

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.