Applied Vinod Kurup's patch 491 for bug 1724 - functions.sh failed if you weren't using daemontools because a newline inserted into the created file confused bash (which isn't used if you're using daemontools, therefore had not been caught by the script author).