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

Re: Bug with bash emulation regarding ':'

> [zsh performs word splitting on ${...:=$(...)}]

It seems strange to perform word splitting on word in ${var=word}
because a single word is required to assign to var. Indeed, zsh pastes
the resulting words back together to a single word to assign.

Historically, there have been two ways to perform word splitting here:
either by expanding the construct as ${var-word} or by expanding $var
after assignment. POSIX requires the latter. This implies that quoting
characters inside word does not prevent word splitting and pathname
generation. (Quoting the entire expansion does.)

In either case, if assignment takes place, the assigned value is the
expanded value of word with quote removal performed on it. (POSIX lacked
the detail of quote removal, formally requiring the assigned value to
retain the quoting characters; an interpretation has been issued.)

Jilles Tjoelker

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