开发者

Single quoted string for sed in Makefile

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜