Created
September 7, 2012 06:10
-
-
Save rpocklin/3663686 to your computer and use it in GitHub Desktop.
Shows the number of processes running given a grep <string> and exit 1 if still running.
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
#!/bin/bash | |
let "RESULT=$(ps ax | grep $1 | wc -l) - 1" ;echo "$RESULT processes found for $1."; if [ "$RESULT" == 0 ]; then exit 0; else exit 1;fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment