我想将“ ON DELETE CASCADE”从一行移到另一行,并且我想使用sed进行操作(这是一个很长的故事)。
我尝试了以下操作,但收到了错误sed: -e expression #1, char 2: unterminated
s命令'
myfunction() {
sed -i -e 's|
CREATE TABLE IDN_REFERENCE (
blah
PRIMARY KEY (ID),
FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES fff(ID) ON DELETE CASCADE ,
FOREIGN KEY (TOKEN_ID) REFERENCES sss(TOKEN_ID),
FOREIGN KEY (CODE_ID) REFERENCES ppp(CODE_ID)
)|
CREATE TABLE IDN_REFERENCE (
blah
PRIMARY KEY (ID),
FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES fff(ID),
FOREIGN KEY (TOKEN_ID) REFERENCES sss(TOKEN_ID) ON DELETE CASCADE ,
FOREIGN KEY (CODE_ID) REFERENCES ppp(CODE_ID)
)|g' myfile
}