标签: linux bash shell sh ash
新行\n未在shell字符串
\n
root@toto:~# str="aaa\nbbbb" root@toto:~# echo $str aaa\nbbbb
预期结果:
root@toto:~# echo $str aaa bbbb
如何在字符串中添加新行?
答案 0 :(得分:63)
$ echo "a\nb" a\nb $ echo -e "a\nb" a b