dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Todor Vlaev <t.vlaev@gmail.com>
To: dash@vger.kernel.org
Subject: [EXPAND] Nested parameter expansion results in an empty string when quoted
Date: Tue, 28 Aug 2012 16:27:24 +0300	[thread overview]
Message-ID: <CAAv6kGS+Cgg2JmRqCeWNZtxpoUuJ0wBSLac0BJJGW8kuiqUgwQ@mail.gmail.com> (raw)

Hi,

While playing around with parameter expansion I noticed that the
following didn't work in dash  (dash 0.5.5.1-7.4ubuntu1) as compared
to bash even though I believe it should be POSIX-compliant:

my_str=swan; last_char="${my_str#${my_str%?}}"; echo ${last_char}

If the double quotes are removed, the last character is printed correctly.

At a quick glance through the commits after the 0.5.5.1 release I saw
the following bug fix. Could it be related?

0d7d66039b614b642c775432fd64aa8c11f9a64d
[EXPAND] Fix quoted pattern patch breakage

Thanks,
Todor

             reply	other threads:[~2012-08-28 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-28 13:27 Todor Vlaev [this message]
2012-08-28 23:00 ` [EXPAND] Nested parameter expansion results in an empty string when quoted Jilles Tjoelker
2012-08-29 13:46   ` Todor Vlaev
2012-08-29 16:35     ` Jonathan Nieder
2013-08-23 10:04 ` Herbert Xu

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=CAAv6kGS+Cgg2JmRqCeWNZtxpoUuJ0wBSLac0BJJGW8kuiqUgwQ@mail.gmail.com \
    --to=t.vlaev@gmail.com \
    --cc=dash@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).