Skip to content

Instantly share code, notes, and snippets.

@schnell18
Created February 26, 2014 03:26
Show Gist options
  • Save schnell18/9223009 to your computer and use it in GitHub Desktop.
Save schnell18/9223009 to your computer and use it in GitHub Desktop.
Get absolute script path regardless how it is called in bash. Reference: http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
SCRIPTPATH=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment