Artificial intelligent assistant

FOR loop not looping I have the below script that uses 2 for loops. for some reason they loop is not looping #! /bin/ksh CURR_PATH='/main/nedcor/flexcube' cd $CURR_PATH for DIR1 in 'WIP' 'INPUT';do echo $DIR1 for DIR in $(find . -name $DIR1);do RESULT=`ls -A $DIR | egrep -v "BKUP|BKP"` echo $DIR echo $RESULT echo $RESULT1 if [ -z "$RESULT" ] ; then echo "No Files found" exit 0 else echo file $RESULT found exit 1 fi done done

You should not be using `exit` inside your `for` loops - this causes the script to exit, and is why you're only getting one result. You should be using `continue`, which will stop the current loop from going on, but will go to the next element in the `for` loop.

Swap both your `exit` statements to `continue` and you should find very different behavior, more in line with what you're looking for.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 5a7aab630de1fbd2c9ea175742f25429