sed 错误:未终止的“s"命令 [英] sed error: unterminated 's' command
本文介绍了sed 错误:未终止的“s"命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 sed 命令下运行
I run below sed command
sed -i s/abc=.*$/abc=def ghi/g hpq_sf_attach_wf_param.txt
它给了我错误:
sed: -e expression #1, char 17: unterminated `s' command
我注意到这是由于 def
和 ghi
之间的空间造成的.知道如何修复它吗?
I noticed it is due to space in between of def
and ghi
.
Any idea how to fix it?
推荐答案
您需要使用引号来保护特殊字符,包括空格、$
和 *
.
You need to use quoting to protect special characters, including spaces, $
, and *
.
sed -i 's/abc=.*$/abc=def ghi/g' hpq_sf_attach_wf_param.txt
这篇关于sed 错误:未终止的“s"命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文