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

Re: z flag in parameter expansion doesn't use $IFS ?



On Fri, 19 Oct 2012 06:18:26 +0800
Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx> wrote:
> It looks like the z flag of parameter expansion doesn't care what the
> value of IFS is:

Yes, this is correct.  It's using the shell grammar for this.  If you
type "echo foo", it doesn't matter what IFS is, it will always treat
that as two words with space as separator.  The other splitting flags
use IFS.

> I just found that it looks like the z flag won't cause "forced joining"
> which stated in rules 10, like this:

Yes, (z) is not like the other splitting flags.  It's a utility for when you
need something that obeys shell parsing rules.  It's not a simple
word-splitting tool, which is what the other splitting flags are for.

pws



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