Failure of nested substring processing inside double-quotes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dash (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
lsb_release -rd:
Description: Ubuntu 14.04.1 LTS
Release: 14.04
apt-cache policy dash
dash:
Installed: 0.5.7-4ubuntu1
Candidate: 0.5.7-4ubuntu1
Version table:
*** 0.5.7-4ubuntu1 0
500 http://
100 /var/lib/
FYI, I reported the bug below on the dash mailing list and got this response from Herbert Xu:
> This is already fixed in the current git tree, by the commit:
>
> commit a7c21a6f4cb42d9
> Author: Herbert Xu <email address hidden>
> Date: Fri Aug 23 20:04:12 2013 +1000
>
> [EXPAND] Propagate EXP_QPAT in subevalvar
I checked dash_0.
----------
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%
/home/.
which is what I expect. However, in dash we get:
dash$ echo $PWD
/home/psmith
dash$ echo ${PWD%${PWD##*/}}.
/home/.
dash$ echo "${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.