The new line \n
is not taken account in the shell strings:
str="aaa\nbbbb"
echo $str
Output:
aaa\nbbbb
Expected result:
aaa
bbbb
How can I add a new line in the string?
The new line \n
is not taken account in the shell strings:
str="aaa\nbbbb"
echo $str
Output:
aaa\nbbbb
Expected result:
aaa
bbbb
How can I add a new line in the string?
$ echo "a\nb"
a\nb
$ echo -e "a\nb"
a
b
© 2022 - 2024 — McMap. All rights reserved.