Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: read & leading (and trailing) spaces
- X-seq: zsh-users 14108
- From: Atom Smasher <atom@xxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: read & leading (and trailing) spaces
- Date: Tue, 12 May 2009 20:06:32 +1200 (NZST)
- In-reply-to: <20090512074013.66710.qmail@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Openpgp: id=0xB88D52E4D9F57808; algo=1 (RSA); size=4096; url=http://atom.smasher.org/pgp.txt
- References: <20090512074013.66710.qmail@xxxxxxxxxxx>
On Tue, 12 May 2009, Atom Smasher wrote:
this doesn't work as advertised when the input includes leading and/or
trailing spaces:
read -r foo ; print -r -- "${foo}"
i can work around that by setting IFS to either null (IFS='') or setting
it to just a newline (IFS='
'). should i expect problems (in older or newer versions of zsh) using
either of those tricks to make read recognize leading/trailing spaces?
===============
it looks like i can also set IFS='\n'. that makes three work-arounds. of
the three, is one best? should any be avoided?
thanks...
--
...atom
________________________
http://atom.smasher.org/
762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
-------------------------------------------------
"In nature there are neither rewards nor punishments -
there are consequences."
-- Robert G. Ingersoll
Messages sorted by:
Reverse Date,
Date,
Thread,
Author