#!/bin/bash fail="none" for i in test-* ; do if [[ "$i" != *.* ]] ; then if ./"$i" >"$i.stdout.log" 2>"$i.stderr.log" ; then echo -ne '[\e[0;32mPASS\e[0m]' else echo -ne '[\e[1;31mFAIL\e[0m]' fail="indeed" fi echo " $i" fi done if [ "$fail" != "none" ] ; then echo 'Test failure(s)' exit 1 else echo Success exit 0 fi