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

Re: extra arguments inserted by glob thinger e:: get sorted afterwards



On Feb 8,  6:16pm, Mikael Magnusson wrote:
}
} As an aside, is "$(echo a b c)" the only way to get an 'inline' array
} in a ${} expression?

The most obvious is ${=:-one two three} which applies word splitting
to the string to the right of the hyphen.  Interestingly this even
works with quoting, where I had assumed it would break within words:

zsh% print -l ${=:-"one two" three\ four 'five six'}
one two
three four
five six

And you can combine it with rcexpandparam:

zsh% print -l X${^=:-"one two" three\ four 'five six'}Z
Xone twoZ
Xthree fourZ
Xfive sixZ


-- 



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