All pastes #957321 Raw Edit

Someone

public text v1 · immutable
#957321 ·published 2008-03-25 22:00 UTC
rendered paste body
#!/bin/bash 
 
myFileHodn="hodnoceni.txt"
subor="a"
adresar="stats"
cesta="$adresar"/"subor"

 
 
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 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
a='NEPUZITY_RETAZEC'
b=0
sucet=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'
  while [ $a -lt "$xhodn_2" ] ;do
    a=`expr $a + 5`
  done

 eval interval_$a='`echo "0"`'
 if [ "$interval_$a" = "" ];then "$interval_$a"="ajshd" <-----nezmeni sa nic
 fi
 let interval_$a++
 echo "$interval_$a"    <-----vypise hornu hranicu intervalu, pre prazdny riadok zmen na "interval_$a"
 
 i=4
 while [ "$i" -lt "$b" ] ;do
   w=`eval $i - 4`
   riadok=""$w" - "$i" : "$(interval_$a)""
   
   
   
   i=`eval $i + 4`
 done
   
  a=`expr $a - 4`
  a_interval=`expr $a_interval + $x`
  if [ "$b" -lt "$a" ] ;then b=`expr $a`;
  fi

  y=`expr $a + 4`
  #echo "$a"_"$y": 1 >> sub   <---radoby vypis intervalu do suboru
  
  b=`expr $b - 1`
  while [ "$b" -gt 0 ] ;do
    c=`expr $b - 4`
#    echo "$b"_"$c": >> sb    <---radoby vypis intervalu do suboru
    b=`expr $b - 5`
  done   
  sucet=`expr $sucet + $xhodn_2`   <----scita vsetky hodnoty
  echo $sucet   
done