-
Always start the script with a shebang line
#!/bin/bash
-
Always run the script directly
chmod +x path/to/script.sh path/to/script.sh
# causes script to exit with error code of any failed command, even in a pipeline
set -e
doesnotexist | grep foo
=> [1] line 5: doesnotexist: command not found
# echo every line before execution
set -x
cron jobs should ...