f



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
0
Nicholas
5/2/2015 9:32:51 AM
comp.unix.shell 15484 articles. 3 followers. Post Follow

1 Replies
1346 Views

Similar Articles

[PageSpeed] 3

Nicholas Namacha <nnamacha@gmail.com> wrote:

>I have the below script that uses 2 for loops. for some reason they loop is not looping

The 'if' contains 'exit' in both paths so the script terminates there.
0
Dave
5/2/2015 12:15:29 PM
Reply: