Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

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`
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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