Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Olof Johansson <olof.johansson@axis.com>
To: Robert Yang <liezhi.yang@windriver.com>
Cc: "openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 1/1] e2fsprogs/populate-extfs.sh: fix a problem on dash
Date: Fri, 24 Jan 2014 16:17:01 +0100	[thread overview]
Message-ID: <20140124151701.GJ15815@axis.com> (raw)
In-Reply-To: <1390571019.17424.173.camel@ted>

On 14-01-24 14:43 +0100, Richard Purdie wrote:
> On Mon, 2014-01-20 at 20:24 +0800, Robert Yang wrote:
> > The dash can't handle the or [[ in parameter expansion, for example:

Good to know. Interesting! Noting that escaping the [ would work,
but not applicable in this case.

> > 
> > A=/usr/bin/[[
> > B=[[
> > C="${A%$B}"

Would ${A%/*}/ work?

-                DIR="${DIR%$TGT}"
+                DIR="${DIR%/*}/"

It also has the advantage that it doesn't cause a fork (afaict,
the loop is being executed for every file in a rootfs directory
structure, that could cause a lot of forks).

(Disclaimer: I haven't tested this)

-- 
olofjn


      reply	other threads:[~2014-01-24 15:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20 12:24 [PATCH 0/1] e2fsprogs/populate-extfs.sh: fix a problem on dash Robert Yang
2014-01-20 12:24 ` [PATCH 1/1] " Robert Yang
2014-01-24 13:43   ` Richard Purdie
2014-01-24 15:17     ` Olof Johansson [this message]

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=20140124151701.GJ15815@axis.com \
    --to=olof.johansson@axis.com \
    --cc=liezhi.yang@windriver.com \
    --cc=openembedded-core@lists.openembedded.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