[英]Uncomment and comment a line of config file using sed in linux
I am having the below text in my-config file 我的配置文件中包含以下文本
<!--<URL>www.abc.com</URL>-->
www.xyz.com
I want to uncomment the commented line and comment the uncommented line. 我要取消注释注释行,并注释未注释行。 I tried using the sed command 我尝试使用sed命令
sed -i '/<!--<URL>www.abc.com</URL>-->/s/^#//g' filename
but getting error as 但由于错误
sed: -e expression #1, char 24: unknown command:
/'` sed: -e expression #1, char 24: unknown command:
/'`
please help in resolving this or correct if anything wrong in my sed command. 请帮助解决此问题,或者在我的sed命令中纠正任何错误。 Thanks in advance. 提前致谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.