> echo ${VAR/\//}
> Unfortunately ${var/pattern/repl} in ash is a bad hack. I looked at it.
> It's hard to fix.
The problem is, you can“t enter a quoted slash / into the pattern.
Either the quote gets removed and the slash separates the pattern from
repl leaving an empty pattern in the example or the quote itself gets
inserted as a quoted quote into the pattern, so it can't quote the slash
:-( ... and we can't look for another slash because we do not know slash
is the separator and which one is part of either the pattern or repl.

you may try this to replace slashes with something different:

VAR="ab/cd"
VAR2=$( echo $VAR | tr / ';' )
echo $VAR2
--> ab;cd
echo ${VAR2/;/xyz}
--> abxyzcd

(bad workaround)

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to