#!/bin/bash partial_filename=".all2all.json" directories=$(find . -mindepth 1 -maxdepth 1 -type d) # count how many folders in this dir count=$(echo $directories | wc -w) if [ $count -eq 0 ]; then echo "No directories found." exit 1 else echo "Found $count directories:" echo $directories fi for dir in $directories; do if [ ! -e "$dir"/*"$partial_filename" ]; then echo "Directory '$dir' does not contain a file matching '$partial_filename'." fi done