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;
精彩评论