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

Re: ${^var} and word splitting



On Nov 24,  3:55pm, Peter Stephenson wrote:
} Subject: Re: ${^var} and word splitting
}
} On Mon, 24 Nov 2014 15:26:28 +0000
} Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
} > If I understand correctly, in zsh the removing of those are
} > accounted to null-removal in things like:
} > 
} > $ print -l $=a
} > 1
} > 2
} > 3
} > 
} > But then it's not clear why they are removed there and not in:
} > 
} > a=':a::b:'
} > IFS=:
} > print -l $=a
} 
} I looked at the code and you're exactly right: it's not clear.

Isn't it always the case that *whitespace* in IFS is treated differently
than non-whitespace?  E.g. consecutive whitespace is treated as a single
character, so (IFS=" " "a  b") is two words but (IFS=: "a::b") is three?

I'm not actually able to try examples at the moment so maybe I'm just not
following something.



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