Bash script – get file script location from within

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

 
source: https://stackoverflow.com/a/246128/2179668