How to escape 2 dollar signs inside a Makefile? [duplicate] How to escape 2 dollar signs inside a Makefile? [duplicate] curl curl

How to escape 2 dollar signs inside a Makefile? [duplicate]


$$ in a make file is replaced by $, try following:

curl -u 'username:pa$$$$word' https://example.com

and see Macros section in make specification.


Inside double-quotes,the shell needs backslashes to avoid dollar expansion.

Makefiles require doubling of dollars to cause a dollar.

So, to use dollars inside double-quotes in a Makefile, you have to do both:

rule:        shell-command ... "pa\$$\$$word" ...