Little Helpers
There is often a need to debug scripts which are started by daemons, so you have no input/output available. The following snippet easily redirects stdout and stderr to a file: #!/bin/bash exec >> /tmp/script_debug.log 2>&1 set -x echo Start: $(date) : buggy code echo Stop: $(date) and here the output: $ cat /tmp/script_debug.log ++ date [...]