Getting the last PID process in a Makefile

My makefile looks something like this:

setsid ./CppServer>daemon.log 2>&1 &
echo $!>daemon.pid

I expect it to store the PID my_awesome_script in the corresponding file. However, there is nothing there. So where is the problem?

+5
source share
2 answers

make , , make, . , , . , , make ; , : . , , ( ), ONESHELL.

+4

, , pid , . echo $! > filename.extension. foregorund, . , . /script _to_run &, script pid echo $$ > filename.extension( script). , http://tldp.org/LDP/abs/html/internalvariables.html

0

All Articles