What value does $ (shell pwd) give?

Looking through the MakeFile, I find

PROJECT_ROOT = $(shell pwd)

What value does it give?

$SHELL provides a shell, and $PWD provides the current working directory. But what does $ (shell pwd) give?

+4
source share
1 answer

The $(shell) function calls the shell to execute the command. The command is executed in this case pwd , as if you were running pwd at the bash command line.

So $(shell pwd) will return the current working directory. You cannot guarantee that the $PWD variable exists in your production environment.

+9
source

All Articles