cd $source for files in $filetype do array=( $files ) [[ "${#array[@]}" == 0 ]] && echo "No files!" echo "it s ok" done