tasks.sh: capture program error messages and print them