Created
September 18, 2018 02:00
-
-
Save jmurphyau/e79f598208931c237d63398479285285 to your computer and use it in GitHub Desktop.
Shell Script Location
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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