diff --git a/unitests.sh b/unitests.sh index 9fcf090..dd10d79 100644 --- a/unitests.sh +++ b/unitests.sh @@ -84,10 +84,15 @@ DEFAULT_DIR="./tests/defaults/" # the ! is for indirect parameter expansion # $i expand in integers 1,2,3... # $1,$2,$3... expand in arguments of process call - FILE="${!i/#/$TEST_DIR}" - FILE="${FILE%.sh}" + FILE="${!i%.sh}" FILE="${FILE/%/.sh}" if ! [ -e "$FILE" ] + then + FILE="${!i/#/$TEST_DIR}" + FILE="${FILE%.sh}" + FILE="${FILE/%/.sh}" + fi + if ! [ -e "$FILE" ] then FILE="${!i/#/$DEFAULT_DIR}" FILE="${FILE%.sh}"