开发者

Copy with sed 's//'

开发者 https://www.devze.com 2023-01-24 03:05 出处:网络
I have a file with various \'return BBQ;\' statements. I\'d l开发者_开发问答ike to change them all to \'exit(BBQ);\\nreturn BBQ;\' (with BBQ being an arbitrary value). Is this possible?Backreferences.

I have a file with various 'return BBQ;' statements. I'd l开发者_开发问答ike to change them all to 'exit(BBQ);\nreturn BBQ;' (with BBQ being an arbitrary value). Is this possible?


Backreferences.

s/return \(BBQ\);/exit(\1);\nreturn \1;/
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号