bump: ash variable substitution, quote slash
Ron Yorston
rmy at pobox.com
Wed Sep 23 09:03:50 UTC 2015
Bastian Bittorf wrote:
>* Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn at axis.com> [23.09.2015 10:44]:
>> > so basically this does not work (no matter how I escape)
>> > var='a/c'; echo ${var////b}
>> ^^^^
>> That looks like a bashism (not portable). Is it this:
>>
>> ${parameter/pattern/string}
>>
>> you're trying to use? In that case, this:
>>
>> v=a/c && echo ${v/\//b}
>>
>> should work for you.
>
>no, as I wrote 'no matter how I escape' - it does not work.
>(busybox git HEAD)
Works for me in Busybox master. The example above, with the slash
escaped by a backslash, has worked since my commit 417622c
(ash: fix breakage of ${v/pat/str}). And there's a test for it
(var-pattern-replacement-in-parameter-expansion-5.tests).
Ron
More information about the busybox
mailing list