After further inspection, the problem seems to come from the lines...
if ps ax | grep -q "^$PID"; then Well, grep will always return 0 (it always finds something... if the pid doesn't exist, it finds its own command line), and this expression will always be false. Changing it to... if ! ps ax | grep -q "^$PID"; then ...fixes the common case, but it doesn't fix the "always finds itself" problem, which means it will spit out some errors if there is no process with pid. -- Carlos Rodrigues -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]