err() {
echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" >&2
}
if ! do_something; then
err "Unable to do_something"
exit 1
fi
# All fits on one line
command1 | command2
# Long commands
command1 \
| command2 \
| command3 \
| command4
case "${flag}" in
a) aflag='true' ;;
b) bflag='true' ;;
f) files="${OPTARG}" ;;
v) verbose='true' ;;
*) error "Unexpected option ${flag}" ;;
esac
for zone in "${zones[@]}"; do
something_with "${zone}"
done