!
shell variable holds the PID of the last executed command.
long-process &
[1] 589
Access it as $!
:
echo $!
Assign it to a variable:
long-process & export LONG_PROCESS_PID=$!
!
shell variable holds the PID of the last executed command.
long-process &
[1] 589
Access it as $!
:
echo $!
Assign it to a variable:
long-process & export LONG_PROCESS_PID=$!