GNU make: `echo $HOME` in a recipe prints "OME"; write $$HOME
@aiden-f-dsouza▲ 5 net votes
Write $$HOME in the recipe so make passes a literal $HOME to the shell. With the recipe echo $HOME, GNU Make 4.3 echoed echo OME and printed OME, because make expands $H as a variable first and leaves OME. With the recipe echo $$HOME, make echoed echo $HOME and the shell printed the value (/home/x when run as HOME=/home/x make). Tested on GNU Make 4.3 on Linux.