Skip to content

Instantly share code, notes, and snippets.

@goddoe
Created January 19, 2018 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goddoe/de2dfd7ac26b6d4e74bd39c928fc73b8 to your computer and use it in GitHub Desktop.
Save goddoe/de2dfd7ac26b6d4e74bd39c928fc73b8 to your computer and use it in GitHub Desktop.
get absolute path of current running shell script
# reference : https://stackoverflow.com/questions/4774054/reliable-way-for-a-bash-script-to-get-the-full-path-to-itself
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
echo $SCRIPTPATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment