`if [[ ! -z ${USE_VALGRIND} ]]; then` Did you mean `if [[ $USE_VALGRIND ]]; then`? :)