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

Re: read & leading (and trailing) spaces



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