I have a variable var="abcde$$$$$$$$fff$$gg". I want to replace all $ with space ' ' but the following puts just one space
var=$( echo "$var" | tr '$' ' ')
How can i replace them all?
you can replace without calling external commands (using bash)
$ var='abcde$$$$$$$$fff$$gg'
$ echo "${var//$/ }"
abcde fff gg
Note that you should use single quotes so that the "$" sign does not get interpolated
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With