All pastes #278278 Raw Edit

Anonymous

public shellscript v1 · immutable
·published 2006-12-13 23:20 UTC
rendered paste body
        date=$(cat $logfile | grep "^L" | head -n1 | awk '{print $2}')        time=$(cat $logfile | grep "^L" | head -n1 | awk '{print $4}' | cut -c 0-8)        start=$(date -d "$date $time" +"%d.%m.%y %T")        enddate=$(cat $logfile | grep "^L" | tail -n1 | awk '{print $2}')        endtime=$(cat $logfile | grep "^L" | tail -n1 | awk '{print $4}' | cut -c 0-8)        secondsStart=$(date -d "$date $time" +%s)        secondsEnd=$(date -d "$date $endtime" +%s)        timespan=$(echo $secondsEnd-$secondsStart | bc)        timespanMinutes=$(echo "$timespan / 60" | bc)        timespanSeconds=$(echo "$timespan % 60" | bc)        if [ "$(echo "length($timespanSeconds)" | bc)" = "1" ]        then                timespanSeconds="0$timespanSeconds"        fi        map=$(grep -m1 "Started map" $logfile | awk '{print $7}' | cut -d \" -f2)        echo "<TR><TD><A href="getlog.cgi?log=$logfile">$logfile</A>"        echo "<TD>$map <TD align="right">$size <TD>$start <TD align="right">$timespanMinutes:$timespanSeconds"