rendered paste body#!/bin/bash
myFileHodn="hodnoceni.txt"
subor="a"
adresar="stats"
for (( i=1 ; i <= $# ; i++ )) ;do
eval arg='$'$i
if ["$arg" = "-h"] ;then i=`expr $i + 1`; eval arg='$'$i ; myFileHodn=$arg
elif ["$arg" = "-o"] ;then i=`expr $i + 1`; eval arg='$'$i ; adresar=$arg
elif ["$arg" = "-g"] ;then echo "TODO: zmeni sa typ vypisu"
elif ["$arg" = "-v"] ;then i=`expr $i + 1`; eval arg='$'$i ; omezeni=$arg
else echo "$arg je neznamy argument." ; exit
fi
done
cesta="$adresar"/"subor"
a='NEPUZITY_RETAZEC'
b=0
sucet=0
counter=0
cat $myFileHodn | while read myLineHodn
do
temphodn="$allFile"
allFile="$temphodn $myLineHodn"
output=`echo $myLineHodn | sed -e "s/ /$a/mg"`
output=`echo $output | sed -e 's/;/ /mg'`
counter=0
for word in $output ; do
eval xhodn_$counter='`echo $word | sed -e s/$a//mg`'
let counter++
done
a='4'
x='1'
sucet=`expr $sucet + 1`
let counter++
while [ $a -lt "$xhodn_2" ] ;do
a=`expr $a + 5`
done
let interval_$a++
if [ "$b" -lt "$a" ] ;then b=`expr $a`;
fi
done
i=4
while [ "$i" -lt "$b" ] ;do
w=`eval $i - 4`
riadok=""$w" - "$i" : "$(interval_$a)""
echo "$riadok" >> "$cesta"
i=`eval $i + 4`
done
echo "Prumer : "$sucet"/"$counter" >> "$cesta"
done