actions based on file type

Hello. I am trying to put together a ksh script that will perform actions on files based on what type they are. The types would be compressed, zipped, or PCL. I think my test conditions are ok, but I'm a little unsure about how to put it all together. I've come up with this, which does not work...

for A in `ls -1 $DIR1`
do
if [ `file $A | grep -c 'ZIP archive'` -ge 1 ]; then
mv $A $ZIPDIR;
if [ `file $A | grep -c 'compressed'` -ge 1 ]; then
mv $A $ZDIR
if [ `grep -c 'LANGUAGE=PCL'` -ge 1 ];then
mv $A $PCLDIR
fi
fi
fi
done

I get the feeling that this is fairly sloppy and there MUST be a way to do this better (and works).

I think your "if" logic needs to be cleaned up. You should probably use "elif" instead of the "if" after the first time you use it. Then you only need one fi at the end. Or, in this case, you may want to use "case" instead of "if".