From: Herbert Xu <herbert@gondor.apana.org.au>
To: Paul Smith <paul@mad-scientist.net>
Cc: dash@vger.kernel.org
Subject: Re: Failure of nested substring processing inside double-quotes
Date: Wed, 8 Oct 2014 10:28:56 +0800 [thread overview]
Message-ID: <20141008022856.GA5783@gondor.apana.org.au> (raw)
In-Reply-To: <1412625793.29340.94.camel@mad-scientist.net>
On Mon, Oct 06, 2014 at 08:03:13PM +0000, Paul Smith wrote:
> 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).
This is already fixed in the current git tree, by the commit:
commit a7c21a6f4cb42d967854cae954efd4ee66bdea9c
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date: Fri Aug 23 20:04:12 2013 +1000
[EXPAND] Propagate EXP_QPAT in subevalvar
So please report this to Ubuntu.
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2014-10-08 2:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-06 20:03 Failure of nested substring processing inside double-quotes Paul Smith
2014-10-08 2:28 ` Herbert Xu [this message]
2014-10-08 5:08 ` Paul Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141008022856.GA5783@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=dash@vger.kernel.org \
--cc=paul@mad-scientist.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.