I have an init script that executes a jar file in the background, and I want to print the PID to a file. Using the following immediately after the execute command the file is created, but it is empty.
start process & \
echo $! >/var/run/foo.pid
Why might this be?
Thanks
Asked by jbeaulau
(61 rep)
Mar 3, 2018, 12:59 AM
Last activity: Mar 5, 2018, 05:23 PM
Last activity: Mar 5, 2018, 05:23 PM