#!/bin/ksh
typeset -i tot_mts_int=0
typeset -i tot_mts_adm=0
typeset -i tot_final=0
typeset -i tot_cu_100=0
typeset -i tot_cu_100_up=0
typeset -i tot_cu_100_restant=0
typeset -i tot_cu_1000=0
typeset -i tot_cu_1000_up=0
typeset -i tot_cu_1000_restant=0
typeset -i tot_fb_100=0
typeset -i tot_fb_100_up=0
typeset -i tot_fb_100_restant=0
typeset -i tot_fb_1000=0
typeset -i tot_fb_1000_up=0
typeset -i tot_fb_1000_restant=0
mts=mts.csv
rm $mts
touch $mts
total_port=total.csv
rm $total_port
touch $total_port
cat INVENTAIRE.csv | grep -i mon >$mts # recherche dans inventaire par rapport a mon et resultat mit dans mts.csv
cat $mts |while read LIGNE
do
set $LIGNE
tot_mts_int=$(($tot_mts_int+$5))
tot_mts_adm=$(($tot_mts_adm+$7))
tot_final=$(($tot_mts_int-$tot_mts_adm))
tot_cu_100=$(($tot_cu_100+$8))
tot_cu_100_up=$(($tot_cu_100_up+$12))
tot_cu_100_restant=$(($tot_cu_100-$tot_cu_100_up))
tot_cu_1000=$(($tot_cu_1000+$9))
tot_cu_1000_up=$(($tot_cu_1000_up+$13))
tot_cu_1000_restant=$(($tot_cu_1000-$tot_cu_1000_up))
tot_fb_100=$(($tot_fb_100+$10))
tot_fb_100_up=$(($tot_fb_100_up0+$14))
tot_fb_100_restant=$(($tot_fb_100-$tot_fb_100_up))
tot_fb_1000=$(($tot_fb_1000+$11))
tot_fb_1000_up=$(($tot_fb_1000_up+$15))
tot_fb_1000_restant=$(($tot_fb_1000-$tot_fb_1000_up))
done
echo " Site de Montsouris" >$total_port
echo " Nbres Int MTS restant;Nbres Cu 100 restant;Nbres Cu 1000 restant;Nbres Fb 100 restant;Nbres Fb 1000 restant" >>$total_port
echo "${tot_final};${tot_cu_100_restant};${tot_cu_1000_restant};${tot_fb_100_restant};${tot_fb_1000_restant}" >>$total_port
Partager