From: "Stefan Fröberg" <stefan.froberg@petroprogram.com>
To: buildroot@busybox.net
Subject: [Buildroot] Bash string manipulation in Kconfig
Date: Mon, 03 Sep 2012 23:12:36 +0300 [thread overview]
Message-ID: <50450F34.4090306@petroprogram.com> (raw)
In-Reply-To: <201209032207.47111.yann.morin.1998@free.fr>
3.9.2012 23:07, Yann E. MORIN kirjoitti:
> Stefan, All,
>
> On Monday 03 September 2012 21:53:52 Stefan Fr?berg wrote:
>> 3.9.2012 22:08, Thomas Petazzoni kirjoitti:
>>> Le Mon, 03 Sep 2012 21:56:31 +0300,
>>> Stefan Fr?berg <stefan.froberg@petroprogram.com> a ?crit :
>>>
>>>> But how to do similar in buildroot .mk files ???
>>> $(notdir $(FOO))
>>>
>>> Thomas
>> One more question:
>>
>> Why does not the following work ?
>>
>> FULL_DOWNLOAD_URL=http://www.somedomain.com/blah/blah/somefile1
>> FULL_DOWNLOAD_URL+=http://www.somedomain2.com/blah2/blah2/blah/somefile2
>>
>> for i in $(FULL_DOWNLOAD_URL);do \
>> echo $(notdir $$i) ; \
>> done
>>
>> I expect it to print:
>>
>> somefile1
>> somefile2
>>
>> But it prints instead:
>>
>> http://www.somedomain.com/blah/blah/somefile1
>> http://www.somedomain2.com/blah2/blah2/blah/somefile2
> That's because $(notdir ...) is onterpreted by make, while $i is
> interpreted by the shell.
>
> In your case, you'd want to use the shell constrcut:
> for i in $(FULL_DOWNLOAD_URL);do \
> echo $${i##*/} ; \
> done
>
> Regards,
> Yann E. MORIN.
>
Ah... I see
Thanks Yann!
And Thanks Thomas!
These shell-make mixing is so confusing ....
Stefan
next prev parent reply other threads:[~2012-09-03 20:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-03 18:56 [Buildroot] Bash string manipulation in Kconfig Stefan Fröberg
2012-09-03 19:08 ` Thomas Petazzoni
2012-09-03 19:13 ` Stefan Fröberg
2012-09-03 19:53 ` Stefan Fröberg
2012-09-03 20:01 ` Thomas Petazzoni
2012-09-03 20:07 ` Stefan Fröberg
2012-09-03 20:07 ` Yann E. MORIN
2012-09-03 20:12 ` Stefan Fröberg [this message]
2012-09-04 5:53 ` Arnout Vandecappelle
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=50450F34.4090306@petroprogram.com \
--to=stefan.froberg@petroprogram.com \
--cc=buildroot@busybox.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.