Hi all. I recently found a bug in dash's handling of substring
processing, when the variable is contained within quotes.
In bash, this works:
bash$ echo $PWD
/home/psmith
bash$ echo ${PWD%${PWD##*/}}.
/home/.
bash$ echo "${PWD%${PWD##*/}}."
/home/.
which is what I expect. However, in dash we get:
dash$ echo $PWD
/home/psmith
dash$ echo ${PWD%${PWD##*/}}.
/home/.
dash$ echo "${PWD%${PWD##*/}}."
.
Whoops! Inside double-quotes dash is mishandling the nested string
substitution. If I break it up into two steps it works OK, regardless
of whether or not it's quoted.
This is dash 0.5.7-4ubuntu1 (from Ubuntu GNOME 14.04).
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html