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?
make , , make, . , , . , , make ; , : . , , ( ), ONESHELL.
, , pid , . echo $! > filename.extension. foregorund, . , . /script _to_run &, script pid echo $$ > filename.extension( script). , http://tldp.org/LDP/abs/html/internalvariables.html