Skip to content

Instantly share code, notes, and snippets.

@diegoulloao
Created April 21, 2019 01:35
Show Gist options
  • Save diegoulloao/5ac3d50f87510bd1505ab371547d673b to your computer and use it in GitHub Desktop.
Save diegoulloao/5ac3d50f87510bd1505ab371547d673b to your computer and use it in GitHub Desktop.
Get current script called directory no matter where called.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# from https://stackoverflow.com/questions/59895/get-the-source-directory-of-a-bash-script-from-within-the-script-itself
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment