简体   繁体   中英

What value does $(shell pwd) give?

Going through a MakeFile I find

PROJECT_ROOT = $(shell pwd)

What value does it give?

$SHELL gives the shell and $PWD gives present working directory But what does $(shell pwd) give?

The $(shell) function calls out to the shell to execute a command. The command being executed in this case is pwd , like if you ran pwd at the bash shell prompt.

So, $(shell pwd) will return the current working directory. You may not be guaranteed that the $PWD variable exists in your make environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM