Friday, November 9, 2018

tarih döngüsü, 2 satiri birlestirmek

for lokasyon in AFY  ANK  ANT  AYT  BLK  BRS  CMP  CP2  ERZ  GZT  HTY  IST  IZM  KRM  MGL  MOB  SMN  SRF  SVS  TRZ  ZNG ; do
    tarihe=$yil-01-01
    while [ "$tarihe" != $ymd ]; do
          tarihe=$(date -I -d "$tarihe + 1 day")
          tarih=`echo $tarihe|sed "s|-||g"`
          sayi=`ls -l /mgmarsiv/radar/$lokasyon/$tarih/*|awk '{print $5}'|awk '{top=top+$NF; print top/1024/1024/1024}'|tail -1`
          echo "$lokasyon: $tarih: $sayi" >> $targetPath/radar.$lokasyon.txt
    done
    boyut=`awk -F ":" '{print $3}' $targetPath/radar.$lokasyon.txt |grep [0-9]|awk '{print top=top+$NF; print top}'|tail -1`
    echo "$lokasyon:$boyut" >> $targetPath/radar.$yil.all.txt
done

No comments: