Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug with bash emulation regarding ':'
- X-seq: zsh-workers 30196
- From: Jilles Tjoelker <jilles@xxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>, Peter Stephenson <pws@xxxxxxx>
- Subject: Re: Bug with bash emulation regarding ':'
- Date: Fri, 10 Feb 2012 12:08:01 +0100
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
> [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