Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[bug] sh: tilde expansion after field splitting
- X-seq: zsh-workers 41811
- From: Martijn Dekker <martijn@xxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [bug] sh: tilde expansion after field splitting
- Date: Thu, 5 Oct 2017 00:20:44 +0200
- 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
POSIX says tilde expansion should be done before parameter expansion and
certainly before field spplitting (shwordsplit):
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06
zsh did this correctly up to version 5.0.8; as of 5.1, it appears to do
tilde expansion *after* field splitting, and only from the second field on.
Test script:
emulate sh
v='~/one ~/two ~/three'
printf '[%s]\n' $v
Actual output:
[~/one]
[/Users/martijn/two]
[/Users/martijn/three]
Expected output:
[~/one]
[~/two]
[~/three]
Thanks,
- M.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author