home *** CD-ROM | disk | FTP | other *** search
/ ftp.orgchm.bas.bg / 2014.06.ftp.orgchm.bas.bg.tar / ftp.orgchm.bas.bg / bin / ccod.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2003-01-12  |  809b  |  41 lines

  1. #!/bin/bash
  2. echo ======= `date` =======
  3.  
  4. chem_from=/disk2/bmech/lsc
  5. life_from=/disk2/bmech/lse
  6. chem_to="/disk2/ccod/chem.phy/20"
  7. life_to="/disk2/ccod/life.sci/20"
  8.  
  9. Unzip_life(){
  10. unzip -qn $file -d  $life_to${file:17:2}
  11. echo $life_to${file:17:2}/${file:17:9}"ISE" 
  12. }
  13. Unzip_chem(){
  14. unzip -qn $file -d  $chem_to${file:17:2}
  15. echo $chem_to${file:17:2}/${file:17:9}"ISC"
  16. }
  17.  
  18. for file in $(find $chem_from -type f -mtime -3)
  19. do
  20.     if [ -d $chem_to${file:17:2} ]
  21.     then
  22.      Unzip_chem
  23.     else
  24.      mkdir $chem_to${file:17:2}
  25.      chmod 755 $chem_to${file:17:2}
  26.      Unzip_chem
  27.     fi
  28. done 
  29.    
  30. for file in $(find $life_from -type f -mtime -3)
  31. do
  32.     if [ -d $life_to${file:17:2} ]
  33.     then
  34.      Unzip_life
  35.     else
  36.      mkdir $life_to${file:17:2}
  37.      chmod 755 $life_to${file:17:2} 
  38.      Unzip_life
  39.     fi 
  40. done
  41.