使用sed将文本附加到文件
问题描述:
如何使用sed将文本写入文件?更具体地说,我会将null变量添加到使用touch创建的空白文本文件中。 sed的语法令我非常困惑。
How can I write text to a file using sed? More specifically I would it add null variables to my blank text file that was created using touch. The syntax of sed is very confusing to me.
答
如果只是将文本附加到文件末尾,则不会首先使用sed。
If you're just appending text to the end of the file then you wouldn't use sed in the first place.
echo "some text" >> somefile.txt