1 2 3 4 5 6 7 8 9
#!/bin/sh # loop until we can kill the process given in arg while : do /usr/bin/pkill -x $* [ $? -eq 0 ] && break sleep 1 done