topical media & game development

talk show tell print

basic-shell-13-processcheck.sh / sh



  #!/bin/sh 
  
  # Checks to see if a given process is running.
  # Pass in a command-line argument of the pattern
  # to look for. The script will output all the
  # occurances.
  
  pattern=$1
  
  ps -e | grep -v $$ | grep pattern | awk '{print $4}'
  
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.