0
我的目标是只有在符合“对话框中的”串 前添加备注“#”具有“重新启动NFS和应用更改”行的sed +在具体线路
为什么我的sed命令字符串前添加备注不要在对话框串之前加上“#”字符? ,有什么不对?在我的语法?
sed -i -r '/Restart nfs and apply changes/s/dialog ?$/#dialog/' /etc/init.d/nfsscript.sh
在/etc/init.d/nfsscript.sh文件中的行:
dialog --clear --colors --title "nfs Config" --yesno "Restart nfs and apply changes?" 10 20
`S /对话框/ \#对话框/`可以简化为`s/dialog/\#&/` – potong 2011-12-15 12:43:58