【发布时间】:2013-09-29 00:22:48
【问题描述】:
我知道可以通过“touch”命令在 ssh 中创建一个文件,然后使用 vi 或 pico 等文本编辑器对其进行编辑并添加内容。
我想知道是否可以创建一个文件并将其内容添加到一个命令行中? 比如:
[create file command] [filename.txt] ["this is the contents of filename.txt"]
我问这是否可能的原因是因为我有一个ssh client in Go,其中一个会话只接受一个调用来运行,我打算将它用于一个没有用户输入的自动化应用程序,所以我想避免使用文本编辑器。
【问题讨论】: