DASH Shell discussions
 help / color / mirror / Atom feed
* Failure of nested substring processing inside double-quotes
@ 2014-10-06 20:03 Paul Smith
  2014-10-08  2:28 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Smith @ 2014-10-06 20:03 UTC (permalink / raw)
  To: dash

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).


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

end of thread, other threads:[~2014-10-08  5:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-06 20:03 Failure of nested substring processing inside double-quotes Paul Smith
2014-10-08  2:28 ` Herbert Xu
2014-10-08  5:08   ` Paul Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox