Skip to content

Instantly share code, notes, and snippets.

@jmurphyau
Created September 18, 2018 02:00
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 jmurphyau/e79f598208931c237d63398479285285 to your computer and use it in GitHub Desktop.
Save jmurphyau/e79f598208931c237d63398479285285 to your computer and use it in GitHub Desktop.
Shell Script Location
# include this at the top of a script to get script location
script_location=$([[ -d $0 ]] && d=${0}/. || d=$0; ( cd -P "$( /usr/bin/dirname "$d" )" && pwd; ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment