In a shell script I tried to replace blank space by \n with this command
echo -e $var |tr ' ' '\n'
Outside the script it workd perfectly but inside there is no effect . This how i use in the script:
var =$(echo -e $var | tr ' ' '\n' )
After expanding a parameter expansion (
See also: http://mywiki.wooledge.org/Quotes
From the Bash manual (
That's why the newline characters are lost.