bash get path of current running script code example Example: bash get path of script SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"