Skip to content

Instantly share code, notes, and snippets.

@commenthol
Last active January 23, 2016 07:52
Show Gist options
  • Save commenthol/3d0fc84daaa361f1cb5e to your computer and use it in GitHub Desktop.
Save commenthol/3d0fc84daaa361f1cb5e to your computer and use it in GitHub Desktop.
get current working dir of running bash script
CWD=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
echo $CWD
echo ${CWD##*/}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment