Created
January 26, 2014 14:47
-
-
Save pasali/8633826 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
DOSYA=$1 | |
OLDIFS=$IFS | |
IFS=, | |
[ ! -f $DOSYA ] && { echo "$DOSYA bulunamadi"; exit 99; } | |
toplam=0 | |
sayac=0 | |
while read ad soyad no not | |
do | |
toplam=$(($toplam+$not)) | |
sayac=$(($sayac + 1)) | |
done < $DOSYA | |
ortalama=$(($toplam/$sayac)) | |
while read ad soyad no not | |
do | |
if [ "$not" -gt "$ortalama" ] | |
then | |
echo $ad,$soyad,$no >> gecenler.csv | |
fi | |
done < $DOSYA | |
IFS=$OLDIFS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment