On Mon, 29 Apr 2002, christopher j bottaro wrote:

> EXCLUDE_LIST = "dir1 dir2 dir3"
> for DIR in `ls -d */` ; do
>       if [ $DIR in $EXCLUDE_LIST ] ; then
>               continue;
>       fi
>       echo $DIR
> done

Try this:

    EXCLUDE_LIST = "dir1 dir2 dir3"
    for DIR in `ls -d */` ; do
        for EXCLUDE in $EXCLUDE_LIST; do
            if [ "$DIR" == "$EXCLUDE" ] ; then
                continue 2  # continue with next DIR (if any)
            fi
        done
        echo $DIR
    done

-- 
"The only thing that helps me maintain my slender grip on reality is the
friendship I share with my collection of singing potatoes."

                        - Holly, JMC Vessel *Red Dwarf*



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to