diff --git a/titan_executor_api/TITAN_Executor_API_test/build_and_run_test.sh b/titan_executor_api/TITAN_Executor_API_test/build_and_run_test.sh
index 7eeb6e856c71dc3536438fb48a6fa937f9a939fe..94b3f499381716c8c633989bc47588f7eb5cee04 100755
--- a/titan_executor_api/TITAN_Executor_API_test/build_and_run_test.sh
+++ b/titan_executor_api/TITAN_Executor_API_test/build_and_run_test.sh
@@ -80,7 +80,8 @@ file_exist ${JUNIT_FULL}
 file_exist ${HAMCREST_FULL}
 
 # run test (and build its dependencies if needed)
-BASEDIR=${0%/*}
+BASEDIR=$(dirname $0)
+echo BASEDIR: $BASEDIR
 ant \
 -f $BASEDIR/build.xml \
 -Djunit.full=${JUNIT_FULL} \