Skip to content

Instantly share code, notes, and snippets.

@kapb14
Created April 8, 2016 17:26
Show Gist options
  • Select an option

  • Save kapb14/6ff9904566975965edc5c2ce47ff2111 to your computer and use it in GitHub Desktop.

Select an option

Save kapb14/6ff9904566975965edc5c2ce47ff2111 to your computer and use it in GitHub Desktop.
bash: path to directory with script
NAME=$(basename $0)
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo -e "NAME: ${NAME}\nDIR: ${DIR}\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment