Issue
Suppose i have a string, $str. I want $str to be edited such that all the spaces in it are replaced by underscores.
Example
a="hello world"
I want the final output of
echo "$a"
to be hello_world
Solution
You could try the following:
str="${str// /_}"
Answered By - William Hay