Daily Archives: October 24th, 2007

Bash Tip: Closing File Descriptors

I recently found that you can close bash file descriptors fairly easily, it goes like this: exec 0>&- # close stdin exec 1>&- # close stdout exec 2>&- # close stderr Which makes it easy to daemonize things using only bash (lets face it there are times when you JUST don’t need anything more than [...]