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

Odd behavior of quoted Zsh array subtraction



I'm sure there's a section of the manual that explains this.

I'm also sure I don't know what section it is.

    $ a=( aa bb cc dd ee  )

    $ b=( cc )

    $ echo ${a:|b}
    aa bb dd ee

    $ echo "${a:|b}"
    aa bb cc dd ee # <-- WHAT

    $ echo "${(@)a:|b}"
    aa bb dd ee

    $ echo "${a[@]:|b}"
    aa bb dd ee

All results except the first quoted expression is the expected result.

Why does the marked, quoted array-subtraction result in a different
set of values?  I would expect that array operators have precedence
over array-converted-to-scalar.  Maybe this is an "outward-in"
expansion issue?




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