是这样的:
cat "Some text here." > myfile.txt
可能的这样myfile.txt
的内容现在将被覆盖为:
Some text here.
这对我不起作用,但也不会引发任何错误.
特别对基于cat
的解决方案感兴趣(不是vim/vi/emacs等).所有在线示例都显示cat
与文件输入一起使用,而不是原始文本...
是这样的:
cat "Some text here." > myfile.txt
可能的这样myfile.txt
的内容现在将被覆盖为:
Some text here.
这对我不起作用,但也不会引发任何错误.
特别对基于cat
的解决方案感兴趣(不是vim/vi/emacs等).所有在线示例都显示cat
与文件输入一起使用,而不是原始文本...
echo
就是这样做的:
echo "Some text here." > myfile.txt