Created
September 17, 2013 16:19
-
-
Save chawkinsuf/6596682 to your computer and use it in GitHub Desktop.
Bash - Get an absolute path to our script directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get an absolute path to our directory | |
basedir="$( cd "$(dirname "$0")" ; pwd -P )" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.