Last active
December 21, 2015 21:29
-
-
Save rahulinux/6368235 to your computer and use it in GitHub Desktop.
Check if process is running or not ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkprocess() { | |
local process=$1 | |
[[ $# -ne 1 ]] && { echo "Usage: $0 process"; exit 1; } | |
if ps cax | grep -q $process; then | |
echo "Process is running." | |
else | |
echo "Process is not running." | |
fi | |
} | |
checkprocess $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment