How to add a new line in the bash string?
82,749
$ echo "a\nb"
a\nb
$ echo -e "a\nb"
a
b
Author by
developer
Updated on July 31, 2020Comments
-
developer almost 4 years
The new line
\n
is not taken account in the shell stringsroot@toto:~# str="aaa\nbbbb" root@toto:~# echo $str aaa\nbbbb
expected result:
root@toto:~# echo $str aaa bbbb
How to add a new line in the string?