zsh-workers
 help / color / mirror / code / Atom feed
* [bug] sh: tilde expansion after field splitting
@ 2017-10-04 22:20 Martijn Dekker
  2017-10-05  5:24 ` Bart Schaefer
  2017-10-08  7:53 ` Bart Schaefer
  0 siblings, 2 replies; 9+ messages in thread
From: Martijn Dekker @ 2017-10-04 22:20 UTC (permalink / raw)
  To: Zsh hackers list

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.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-10-13 15:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-04 22:20 [bug] sh: tilde expansion after field splitting Martijn Dekker
2017-10-05  5:24 ` Bart Schaefer
2017-10-08  7:53 ` Bart Schaefer
2017-10-08 19:20   ` Peter Stephenson
2017-10-08 20:45     ` Bart Schaefer
2017-10-09  8:44       ` Peter Stephenson
2017-10-13  9:43   ` Martijn Dekker
2017-10-13 12:55     ` Peter Stephenson
2017-10-13 15:36       ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).