Can any one help me to correct following script.
I have 2 directories DropZone and ProcessZone. File pattern is *VEHDESCSUM*.
Finding the 'no of files' in DropZone directory using ls *VEHDESCSUM* |wc -l
If DropZone has more than one file or 0 files then exit 1
If DropZone has one file then move file from DropZone to ProcessZone.
I am trying with the following code. But I am getting errors.
#!/bin/sh
##########################################################
DROP_ZONE=/apps/dsadm/GMCCi2/DropZone
PROCESS_ZONE=/apps/dsadm/GMCCi2/ProcessZone
echo ${DROP_ZONE}
echo ${PROCESS_ZONE}
cd $DROP_ZONE
cnt = ls *VEHDESCSUM* |wc -l
echo ${cnt}
if [ cnt -gt 1 ]
then
exit 1
else
mv $DROP_ZONE/*VEHDESCSUM* $PROCESS_ZONE
exit 0
fi
##########################################################
thanks for all