Created
December 5, 2018 12:50
-
-
Save jtr109/131f73e3ef60f78ed3954b891f77a964 to your computer and use it in GitHub Desktop.
get path of the executed bash file
This file contains hidden or 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
#!/bin/bash | |
# reference: https://stackoverflow.com/questions/4774054/reliable-way-for-a-bash-script-to-get-the-full-path-to-itself | |
currentDir=$( | |
cd $(dirname "$0") | |
pwd | |
) | |
echo -n "current " | |
pwd | |
echo script $currentDir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment