Skip to content

Instantly share code, notes, and snippets.

@zedr
Last active October 15, 2023 09:31
Show Gist options
  • Save zedr/00304e23343981b2db149c3968d05202 to your computer and use it in GitHub Desktop.
Save zedr/00304e23343981b2db149c3968d05202 to your computer and use it in GitHub Desktop.
Bash defaults
#!/usr/bin/env bash
set -o pipefail
set -o errexit
set -o nounset
dir1=${1:-}
dir2=${2:-}
usage() {
echo "Usage: ${0} DIR1 DIR2"
}
if [[ -z $dir1 ]] || [[ -z $dir2 ]]; then
usage
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment