Determine bash script's location from bash script
Snippet
Written with a loving hand by kitt some time around 14:54 on 23 October 2016
Sometimes, you need to know the current (full-path) directory of a bash script in order to launch another file relative to the bash script, instead of using global paths or the $PATH value.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Add new comment