FROM=/usr/src/redhat/RPMS/cjs TO=/mnt/src/scientific/30rolling/i386/SL/RPMS/ TO2=/mnt/src/scientific/30rolling/i386/notsupported/RPMS/ TO3=/mnt/src/scientific/30rolling/i386/errata/debuginfo/RPMS/ echo "Checking in rpms from $FROM are in $TO and $TO2 and $TO3" cd $FROM for i in *.rpm do if [ -f $TO/$i ] ; then echo "$i exists in $TO" mv $FROM/$i $TO else if [ -f $TO2/$i ] ; then echo "$i exists in $TO2" mv $FROM/$i $TO2 else if [ -f $TO3/$i ] ; then echo "$i exists in $TO3" mv $FROM/$i $TO3 else echo "$i does NOT exist" fi fi fi done