I was trying to write a script to run a couple of background processes then wait for an interrupt signal from the keyboard. There's a nice way to do this with waits, but an even shorter way (if you have GNU -- i.e. almost all Linux machines) is:
function shutdown() {
# do stuff
}
trap shutdown INT
sleep inf
Monday, July 20, 2015
Subscribe to:
Posts (Atom)