我正在学习SED,我看到了这个sed替换示例。它应该将每个新行中的第一个小写字母t替换为大写。
$ sed 's/t/T' text-01.txt
sed: -e expression #1, char 5: unterminated `s' command文件内容:
$ cat text-01.txt
10 tiny toes
this is that
5 funny 0
one two three
tree twice不过,这并不是世界末日,因为我可以直接输出到一个新文件中:
cat text-01.txt | sed 's/t/T/' > text-02.txt但是,如果我想要编辑原始文件,我应该怎么做?
发布于 2018-10-12 22:30:42
这两个命令并不相同,第一个命令缺少结束的/:
# v
sed 's/t/T' text-01.txt
cat text-01.txt | sed 's/t/T/' > text-02.txt
# ^https://stackoverflow.com/questions/52781673
复制相似问题