How can I have a newline in a string in sh?
- by juannavarroperez
This
STR="Hello\nWorld"
echo $STR
produces as output
Hello\nWorld
instead of
Hello
World
What should I do to have a newline in a string? I'm aware of echo -e, but I'm no sending the string to echo, the string will be used as an argument by another command that doesn't know how to interpret \n as a newline.