Kann mir bitte jemand diesen Fehler rerkl�ren?
Ohne Zuweisung gehts und es kommt der modifizierte String raus.
Weise ich es einem String zu kommt dieser Fehler.
Was mache ich da flasch?
Hi latenite, you need to write in English here. This works:
var=$(echo ${STRING} | sed -e 's/\//\\\//g')
I do not know why, I thought the `...` and $( ... ) constructs were equivalent, although I much prefer (and always use) the latter. Note that you can also replace the '/' by a different character (e.g. ':'), (so that you do not have to escape the '/'-characters) like this:
var=$(echo "${STRING}" | sed 's:/:\\/:g')
or simply this:
var=${STRING//\//\\/}
---------- Post updated at 03:57 PM ---------- Previous update was at 03:43 PM ----------
If you use backticks then you appear to have to do more escaping: