lundi 5 avril 2010

unix / linux : bash scripts compteur

petit script utilisant des variables ...

#!/bin/bash
echo "demarrage analyse FS";
ptsMontages=`df -k`;



((i=0));
((first=0));
((val=1));
for currentPt in $ptsMontages;
do
((i++));
if test $i -ge 8
then
((first++));
((val=first%7));
fi

if test $val -eq 0
then
echo "trouve [$i] [$first] [$val]= [$currentPt]";
fi
done
echo "fin analyse FS";


Aucun commentaire:

Enregistrer un commentaire