【发布时间】:2012-02-03 02:18:06
【问题描述】:
如何在不换行的情况下将字符串添加到文件末尾?
例如,如果我使用 >> 它将添加到文件末尾并带有换行符:
cat list.txt
yourText1
root@host-37:/# echo yourText2 >> list.txt
root@host-37:/# cat list.txt
yourText1
yourText2
我想在 yourText1 之后添加 yourText2
root@host-37:/# cat list.txt
yourText1yourText2
【问题讨论】:
-
echo -n 似乎是您要查找的命令。