seq with regex, error message for mysql quotes

6,334

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:
6,334

Related videos on Youtube

Franz Kafka
Author by

Franz Kafka

Czech beer is awesome

Updated on September 18, 2022

Comments

  • Franz Kafka
    Franz Kafka almost 2 years

    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?