bash - sed command to replace part of file -
this question has answer here:
- use slashes in sed replace 1 answer
hi want replace part of /etc/sysconfig/file
consists:
options='--para' cert_path=/etc/cert
i want replace options='--para'
options='--para --para2 172.0.0.0/16'
so tried:
sudo sed -i 's/"options='--para'"/"`options='--para --para2 172.0.0.0/16'"/' /etc/sysconfig/file
but error:
edit /etc/sysconfig/file sed: -e expression #1, char 88: unknown option `s'
can me correct sed-command
try this:
sudo sed -i "s#options='--para'#options='--para --para2 172.0.0.0/16'#" /etc/sysconfig/file
Comments
Post a Comment