Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
シェル文字列では改行\nは考慮されません
\n
root@toto:~# str="aaa\nbbbb" root@toto:~# echo $str aaa\nbbbb
期待される結果:
root@toto:~# echo $str aaa bbbb
文字列に新しい行を追加する方法は?
$ echo "a\nb" a\nb $ echo -e "a\nb" a b