On 2025-Mar-14, David E. Wheeler wrote:
> But, just. WAT. 30 years in this business and shell string escaping
> continues to elude me. I tried lots of different combinations of
> escaping, but this weird double-$ never occurred to me.
It's make. From its info manual:
6.1 Basics of Variable References
To substitute a variable’s value, write a dollar sign followed by the name
of the variable in parentheses or braces: either ‘$(foo)’ or ‘${foo}’ is a
valid reference to the variable foo. This special significance of
‘$’ is why you must write ‘$$’ to have the effect of a single dollar sign in
a file name or recipe.
I'm surprised that you don't need \$\$ though. I wonder if
make CFLAGS='-Wl,-rpath,$$ORIGIN'
isn't enough actually?
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Learn about compilers. Then everything looks like either a compiler or
a database, and now you have two problems but one of them is fun."
https://twitter.com/thingskatedid/status/1456027786158776329