Skip to content

Instantly share code, notes, and snippets.

@aaronsaderholm
Created September 19, 2017 16:41
Show Gist options
  • Save aaronsaderholm/677841f437572e36de72f30748e81ad5 to your computer and use it in GitHub Desktop.
Save aaronsaderholm/677841f437572e36de72f30748e81ad5 to your computer and use it in GitHub Desktop.
Get directory of bash script (https://stackoverflow.com/a/246128)
#!/usr/bin/env bash
# Credits to https://stackoverflow.com/a/246128
# Just added here for reference.
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