通过从UNIX命令行运行单命令行程序,可以利用多种有意义和复合的方式(无需编辑器)对文本文件进行编辑。
Text files can be edited in significant and complex ways without an editor by running one-liners from the UNIX command line.
虽然这个单命令行程序非常简单,但是它的缺点在于创建了一个新文件。
Although it's simple, the disadvantage of this one-liner is that it creates a new file.
对于脚本中的特别单命令行程序,可以使用 echo 将一组命令和文本管道传输给 ed,从而以非交互式的方式使用它。
For ad hoc one-liners in scripts, use ed noninteractively by piping a group of commands and text to it with echo
应用推荐