#!/bin/sh

# kill all processes whose command line contains the arguments
# specified with this script
#
# example: kill_proc ssh_pause imap
#
# this kills all processes containing the string "ssh_pause imap"
# in their command line

# the specific "ps" command to be used
PS='ps -auxww'

procs=`$PS | fgrep "$*" | fgrep -v fgrep | fgrep -v "$0" | \
      awk '{ print $2 }' | sort -n`

kill $procs
