- 论坛徽章:
- 0
|
- #/bin/bash
- ###########Variable Define
- DELPATH=/home2/ypan/
- INPUTPATH=/new/input/in/
- FILENAME=`ls "$DELPATH"`
- ##########Ready to go
- echo "######Ready to copy WFM310 input files####"
- cd $DELPATH
- ######check if input file arrived
- test -f $FILENAME&&echo "#######INPUT FILE ARRIVED ,Ready To Move#####"
- ##############unzip input file
- echo "##########Unzip The Input File...############"
- unzip $FILENAME
- #########MOVE ZIP FILE INTO STATING
- echo "####Backup the ZIP file#########"
- mv $FILENAME ../staging/
- ######COPY UNZIPPED FILES INTO INPUT PATH
- echo "#####Copy the Unzip Files Into Input Path...#####"
- mv * $INPUTPATH
- ##########Show the volume information
- echo "############Change Directory to Input Path##########"
- cd $INPUTPATH
- echo "############Ready to Fetch the volume information...#######"
- OLLW=`ls PROD*OLLW.txt`
- OOFF=`ls PROD*OOFF.txt`
- #####Set the Variable
- OLLW_A=`cat $OLLW|tail -1|cut -d ' ' -f 1`
- OLLW_B=`cat $OLLW|tail -1|cut -d ' ' -f 5`
- OOFF_A=`cat $OOFF|tail -1|cut -d ' ' -f 1`
- OOFF_B=`cat $OOFF|tail -1|cut -d ' ' -f 5`
- #####Rip the '00' at the beginning of digits
- LA=`echo $OLLW_A |awk '{print $0+0}'`
- LB=`echo $OLLW_B |awk '{print $0+0}'`
- OA=`echo $OOFF_A |awk '{print $0+0}'`
- OB=`echo $OOFF_B |awk '{print $0+0}'`
- #####Plus the value
- let T_A=LA+OA
- let T_B=LB+TB
- ####Print the volume email
- echo"#########################################"
- echo"File Type |"echo "CON Files |"echo"Letter ID Count|"echo"Total Letter Count|"
- echo"------------------------------------------------------------------------------------------------------"
- echo"OLLW "echo"$OLLW |" echo"$OLLW_A |"echo"$OLLW_B |"
- echo"------------------------------------------------------------------------------------------------------"
- echo"OOLL "echo"$OOFF|" echo"$OOFF_A |"echo"$OOFF_B |"
- echo"------------------------------------------------------------------------------------------------------"
- echo"Total |" echo"$T_A |" echo"$T_B |"
- echo"------------------------------------------------------------------------------------------------------"
复制代码 回复 8# 关阴月飞
|
|