Skip to content

Instantly share code, notes, and snippets.

@stoyanovgeorge
Created February 11, 2019 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stoyanovgeorge/36724823ac0a44862dd48110aa272c58 to your computer and use it in GitHub Desktop.
Save stoyanovgeorge/36724823ac0a44862dd48110aa272c58 to your computer and use it in GitHub Desktop.
Check if a PID (process ID is running and return True in case it does.
#!/bin/bash
if [[ $(ps -o pid= -p 2310) -ne 0 ]]; then
echo "True"
else
echo "False"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment