Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Reading line by line



sac wrote:
> 2. Like Micah J. Cowan pointed out, 
> 
> while read i
> do
> echo $i
> done < filename

As Stephane points out, -r is preferable, as it disables
backslash-escaping. IFS= should not be necessary--and isn't, in zsh--but
dash, bash and ksh all violate POSIX (as I read it) by inserting new
field separators after splitting, instead of using the original
separation; so using IFS= is portable.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/



Messages sorted by: Reverse Date, Date, Thread, Author