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

[bug] sh: tilde expansion after field splitting



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