Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Reading line by line
- X-seq: zsh-users 11385
- From: Micah Cowan <micah@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Reading line by line
- Date: Wed, 11 Apr 2007 11:13:21 -0700
- In-reply-to: <242911.74922.qm@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <242911.74922.qm@xxxxxxxxxxxxxxxxxxxxxxxxx>
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