#!/bin/bash -x ls -l $1 cd $1 LIST=$(ls -r | grep TPTP) for DIR in $LIST; do if [ ! -f $DIR/.complete ]; then if [ -f $DIR/.tocomplete ]; then echo "Find $DIR" fi fi done