Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash get current process id

$! is the PID of the last backgrounded process.
kill -0 $PID checks whether it's still running.
$$ is the PID of the current shell.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #current #process #id
ADD COMMENT
Topic
Name
1+6 =