diff --git a/pmd-dist/src/main/resources/scripts/pmd b/pmd-dist/src/main/resources/scripts/pmd index 926238f9da..73476fdab9 100755 --- a/pmd-dist/src/main/resources/scripts/pmd +++ b/pmd-dist/src/main/resources/scripts/pmd @@ -52,7 +52,7 @@ set_lib_dir() { if [ -L "$0" ]; then local script_real_loc=$(readlink "$0") else - local script_real_loc=$0 + local script_real_loc=${BASH_SOURCE[0]:-${(%):-%x}} fi local script_dir=$(dirname "${script_real_loc}") @@ -74,7 +74,7 @@ set_conf_dir() { if [ -L $0 ]; then local script_real_loc=$(readlink "$0") else - local script_real_loc=$0 + local script_real_loc=${BASH_SOURCE[0]:-${(%):-%x}} fi local script_dir=$(dirname "${script_real_loc}")