1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
calculbulletin(){
cheminetudiants=/home/fred/examen/Etudiants
cheminbulletins=/home/fred/examen/Bulletins
cheminbackup=/home/fred/examen/Backup
#cd "$cheminbackup"
#nbcours= ls "$cheminbackup" | wc -l
cd "$cheminetudiants"
cp * "$cheminbulletins"
cd "$cheminbulletins"
FILES=/home/fred/examen/Bulletins/*
#echo "$nbcours"
totalpoints=0
for f in $FILES
do
echo "$f"
cat $f | while read cours point
do
let "totalpoints= totalpoints+point"
#echo "$totalpoints"
done
done
echo "$totalpoints"
} |