Escaping parentheses in bash/sed -
this question has answer here:
i've got issues escaping parentheses in string, using bash , sed.
here's i'm doing:
#!/bin/bash olddescription='(1 phrase/line)' newdescription="\"$volledigenaam\"" (cd /home/hew/git/odoo/addons/$technischenaam ; sed -i s/$olddescription/$newdescription/g __openerp__.py) i've read if use single quotes, don't need escape parentheses. tried escaping parentheses backslash didn't work either.
this error:
sed: -e expression #1, char 4: unterminated `s' command
any ideas on how solve this?
scape slash in value of olddescription:
olddescription='(1 phrase\/line)';
then, can try this: sed -i "s/$olddescription/$newdescription/g" __openerp__.py
Comments
Post a Comment