yash-rs
yash-rs copied to clipboard
Tilde expansion in switch word in assignment
trafficstars
Should tildes in a=${b-~:~} be parsed as tilde expansions or literal characters? Existing shells seem disagree.
$ shells -c 'HOME=HOME; a=${b-~:~}; echo "$a"'
==> bash <==
HOME:HOME
==> bash --posix <==
HOME:~
==> dash <==
HOME:HOME
==> ksh <==
HOME:~
==> mksh <==
HOME:HOME
==> mksh -o posix <==
HOME:HOME
==> mksh -o sh <==
HOME:HOME
==> yash <==
~:~
==> yash -o posix <==
~:~
==> zsh <==
HOME:HOME
==> zsh --emulate sh <==
~:~
==> zsh --emulate ksh <==
~:~