#!/bin/bash set -eu set -o pipefail IFS=' ' find . -mindepth 1 -maxdepth 1 -type d -print | \ while read directory do echo "$directory" ( set -eu set -o pipefail cd "$directory" if make then echo "$0: $directory is no longer failing" # This was intended to sound a bell, but it wasn't working :-S # echo | tr '\012' '\007' echo echo sleep 10 else echo "$0: $directory is still failing" fi ) done