Skip to content

Instantly share code, notes, and snippets.

@rpocklin
Created September 7, 2012 06:10
Show Gist options
  • Save rpocklin/3663686 to your computer and use it in GitHub Desktop.
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.
#!/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