I decided that I want the exec line at the end of the script because I want the exit code of the script to be the exit code of the Java process. I'm willing to live with the fact that the sleep thread will wait its full 3 seconds. So my final script is this:
#!/bin/sh cd `dirname "$0"` CLASSPATH="mapgen.jar" export CLASSPATH THIS_SCRIPT_PROCESS="$$" sleep 3 && kill "$THIS_SCRIPT_PROCESS" > /dev/null 2>&1 && \ echo "Terminated infinite looping." 1>&2 & #SLEEP_PROCESS="$!" exec /usr/local/bin/java $* _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"