Skip to content

Instantly share code, notes, and snippets.

@Calinou
Last active October 30, 2020 17:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Calinou/b7703bac1ac048416f0adf36f801d261 to your computer and use it in GitHub Desktop.
Save Calinou/b7703bac1ac048416f0adf36f801d261 to your computer and use it in GitHub Desktop.
Bash script boilerplate (safer programming practices + allow running from any location without using `cd` beforehand)
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment