开发者

Single quoted string for sed in Makefile

开发者 https://www.devze.com 2023-01-30 22:33 出处:网络
I am calling sed from my Makefile, and this line doesn\'t work: sed 开发者_运维百科-i -r \'s|^(3)$|5|\' file;

I am calling sed from my Makefile, and this line doesn't work:

sed 开发者_运维百科-i -r 's|^(3)$|5|' file;

It's perfectly fine if I call from the terminal, but GNU make reports the following error:

sed: -e expression #1, char 8: unterminated `s' command

Any ideas how I can fix this, and could you provide any manual on how Makefile deals with strings? Thanks.


$ has a special meaning in makefiles. Use $$ cancel it:

sed -i -r 's|^(3)$$|5|' file;
0

精彩评论

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