sed:-e表达式#1,字符5:unterminated`s';命令
我正在学习SED,我看到了这个SED替换示例。它应该在每一行中替换第一个小写字母t作为大写字母:sed:-e表达式#1,字符5:unterminated`s';命令,sed,Sed,我正在学习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 但这并不是世界末日,因为我可
$ 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
但是如果我想编辑原始文件,我该怎么办呢?命令不一样,第一个命令中缺少关闭的
/
:
# v
sed 's/t/T' text-01.txt
cat text-01.txt | sed 's/t/T/' > text-02.txt
# ^
谢谢你的快速纠正