#!/bin/bash # # faturaayir # Telsim Faturalarini Ayiklama bash Scripti # Nisan 2002 # Ilker FICICILAR # ilkerf@geocities.com # https://ilkerf.tripod.com/teknik/ # http://ekitap.kolayweb.com/ # http://mezopotamya.tripod.com/ # ds=$1 if [ "$ds" != "" ];then echo echo Telefon Hacamalari echo echo "(KDV Dahil, OIV Haric)" echo on="qwerty" on=`grep Telefon $ds | sed "s/\.//g" | cut -f2 -d: | cut -b4-14 | sort | head -1` top=0 gntop=0 ay=0 ar=0 ps=0 te=0 tu=0 (grep Telefon $ds | sed "s/\.//g" | cut -f2 -d: | cut -b4-14,19- | sort ; echo qwerty 0 ) | while read satir do set $satir no=$1 tutar=$2 if [ "$no" == "$on" ];then top=`expr $top + $tutar` else echo $on $top gntop=`expr $gntop + $top` op=`echo $on | cut -b-3` if [ "$op" == "050" ];then ay=`expr $ay + $top` elif [ "$op" == "055" ];then ar=`expr $ar + $top` elif [ "$op" == "054" ];then te=`expr $te + $top` elif [ "$op" == "053" ];then tu=`expr $tu + $top` else ps=`expr $ps + $top` fi on=$no top=$tutar fi if [ "$no" == "qwerty" ];then echo echo Genel Toplam: $gntop echo echo "Aycell : $ay" echo "Aria : $ar" echo "PSTN : $ps" echo "Telsim : $te" echo "Turkcell: $tu" echo fi done else echo echo HANGi DOSYAYI iSLiYORUZ? echo echo WWW Tarayicidan kaydettiginiz, duz metin dosyasi bicimindeki echo telsim faturasinin adini, echo echo "bash$ faturaayir faturadi.txt" echo echo seklinde belirtiniz. echo echo echo faturaayir echo Telsim Fatura Ayirma bash Scripti echo Nisan 2002 echo Ilker FICIILAR echo ilkerf@geocities.com echo fi