#!/bin/bash [ -z $1 ]||[ -z $2 ] && { echo echo "Syntax: after " echo exit } fnord=`ps ax` count=1 until [ $count -eq 0 ] do fnord=`ps ax` count=$(grep -c $1 $fnord) sleep 1 done $2