I have the following script to output a report of response times - but it is throwing the error:
./jobname[46]: -: 0403-053 Expression is not complete; more tokens expected.
Here is the code, any ideas what the problem is?
(line 46 is simply, LC=0)
FILE2=/templogs/access_log
FILE3=/templogs/access_log.1
integer LINES=0
integer i5=0
integer i10=0
integer i20=0
integer i30=0
integer i60=0
integer i60p=0
integer TIME=0
integer U=0
integer T=0
integer C=0
typeset -i LT=0
typeset -i LC=0
echo "Time Total 0-5 5-10 10-20 20-30 30-60 60+ Users Avg tm"
echo ------------------------------------------------------------------------------------------------------------------------------
for HOURS in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
do
for MINS in 0[0-9] 1[0-9] 2[0-9] 3[0-9] 4[0-9] 5[0-9]
do
MYTIME=`echo $MINS | cut -d"[" -f1`
#get users
T=0
C=0
for U in `grep "^$HOURS" /templogs/joblog.users | grep -v "Start" | cut -d" " -f2`
do
C=$C+1
T=$T+$U
done
T=$T*2
grep "20..:$HOURS:${MINS}" $FILE2 > $FILE3
i5=0
i10=0
i20=0
i30=0
i60=0
i60p=0
LINES=`wc -l $FILE3 | awk '{printf("%d\n",$1);}`
LT=0
LC=0
for TIME in `cat $FILE3 | awk '{printf("%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s\n",$16,$15,$14,$13,$12,$11,$10,$9,$8,$7,$6,$5,$4,$3,$2,$1);}' | awk '{printf("%s\n",$1);}'`
do
LT=$LT+$TIME
LC=$LC+1
if [ $TIME -lt 5 ]; then
i5=$i5+1
elif [ $TIME -lt 10 ]; then
i10=$i10+1
elif [ $TIME -lt 20 ]; then
i20=$i20+1
elif [ $TIME -lt 30 ]; then
i30=$i30+1
elif [ $TIME -lt 60 ]; then
i60=$i60+1
else
i60p=$i60p+1
fi
done
if [ $C -eq 0 ]; then
C=1
fi
if [[ -s $FILE3 ]]; then
echo ${HOURS}:${MYTIME} $LINES $i5 $i10 $i20 $i30 $i60 $i60p $T $C $LT $LC| awk '{ printf("%s0:00-%s9:59 %5d %5d (%05.2f%%) %6d (%05.2f%%) %4d (%05.2f%%) %4d (%05.2f%%) %4d (%05.2f%%) %4d (%05.2f%%) %5.1f %5.1f\n",$1,$1,$2,$3,($3*100/$2),$4,($4*100/$2),$5,($5*100/$2),$6,($6*100/$2),$7,($7*100/$2),$8,($8*100/$2),($9/$10),($11/$12));}'
fi
done
done