Skip to content

Instantly share code, notes, and snippets.

@chawkinsuf
Created September 17, 2013 16:19
Show Gist options
  • Save chawkinsuf/6596682 to your computer and use it in GitHub Desktop.
Save chawkinsuf/6596682 to your computer and use it in GitHub Desktop.
Bash - Get an absolute path to our script directory
# Get an absolute path to our directory
basedir="$( cd "$(dirname "$0")" ; pwd -P )"
@chawkinsuf
Copy link
Author

It took me too long to find this solution for an absolute path to the executing script's directory, but it is so simple. Use it wisely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment