I have file .config with line :
projdir name_of_the_projdir
I need to with replace name_of_the_projdir with my own variable. I try to do it with
sed -i 's/^projdir .*$/projdir '$projdir'/' .le/.config
but i get error
sed: -e expression #1, char 25: unknown option to `s'
anyone know what to do ?... i try to replace first ' and last with " and first and alst / with @ . But still not work
You get that error because the /
delimiters you use with the substitute command are clashing with the directory separators. You can change them to something else:
sed -i 's!^projdir .*$!projdir '$projdir'!' .le/.config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With