Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Odd behavior of quoted Zsh array subtraction
- X-seq: zsh-users 26797
- From: Zach Riggle <zachriggle@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Odd behavior of quoted Zsh array subtraction
- Date: Fri, 23 Jul 2021 04:39:15 -0500
- Archived-at: <https://zsh.org/users/26797>
- List-id: <zsh-users.zsh.org>
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