# add this set -x dir=/run/regenerate-initrd if ! test -d "$dir"; then exit 0 fi # add this, too ls -l "$dir" Thanks!