Skip to content

Instantly share code, notes, and snippets.

@piaoger
Created January 12, 2016 09:23
Show Gist options
  • Save piaoger/5636426ea05c9529d4e0 to your computer and use it in GitHub Desktop.
Save piaoger/5636426ea05c9529d4e0 to your computer and use it in GitHub Desktop.
get location of bash script
this_script=$(cd ${0%/*} && echo $PWD/${0##*/})
this_dir=$(cd ${0%/*} && echo $PWD)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment