if [ -z "$1" ]; then echo "Give me something to GREP for in the command line of ps!!" exit 1 fi LIST=$(ps ax -o pid,user,comm|grep -e"$1" | grep -e"$USER"|grep -ve"grep") if [ -z "$LIST" ]; then echo "$1 wasn't found!" exit 2 fi echo $LIST | sed -e's:^ *::'|cut -d" " -f1|xargs schedtool $2