Is there some tool that auto quotes regex for seq?

I can't figure out what I'm doing wrong. I always get this error unterminateds' command`

sed -i 's/INSERT INTO `tablename.*`/INSERT INTO \`othertable\`' *.sql

Do I have to quote these special mysql quotes?

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

You lack a terminating slash (the second-last character):

's/INSERT INTO `tablename.*`/INSERT INTO \`othertable\`/'

This works in bash, but obviously will not work on Windows cmd:

echo INSERT INTO '`tablenameasdf`' | sed 's/INSERT INTO `tablename.*`/INSERT INTO \`othertable\`/'
INSERT INTO `othertable`
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.