I want to replace below line with sed so I am trying below command which is giving me error "sed: -e expression #1, char 59: unknown option to `s'"
I have not known to sed much can you guys help what I am missing in below command
sed -i 's/"\#trusted_proxies = "/"trusted_proxies = 172.16.0.0/12, 172.17.0.0/12, 172.18.0.0/12, 172.19.0.0/12 "/g' runup.shit is giving "sed: -e expression #1, char 59: unknown option to `s'" error.
Regards, SAMURAI
1 Answer
It's because you have / characters in your replacement text and you're also using / as your sed delimiter. Try using a different character as your sed delimiter, like ::
sed -i 's:"\#trusted_proxies = ":"trusted_proxies = 172.16.0.0/12, 172.17.0.0/12, 172.18.0.0/12, 172.19.0.0/12 ":g' runup.sh