2010-10-05

The internal variable $! in Bash

Great use of a Internal variable in Bash

Using $! for job control:
possibly_hanging_job & { sleep ${TIMEOUT}; eval 'kill -9 $!' &> /dev/null; }
# Forces completion of an ill-behaved program.
# Useful, for example, in init scripts.