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

field splitting behavior



Take a look at the following:

> var='foo:bar' 
> echo ${(@)${(s/:/)var}[1]}
foo

> var='foobar'
> echo ${(@)${(s/:/)var}[1]}
f

So why it did field splitting on each character when there is no
separator ':' found?  I would expect 'foobar' on the output.

Thanks in advance..



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