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
$1
but your question body says$!
. Which is it?start process
thing actually run or did you get a "no such file or directory" error? (i.e. isPATH
correctly set in the script?)