#!/bin/bash

if [ -z "$1" ]
then
    echo "Please give a file name as arg eg:"
    echo "$(basename $0)   .../LITproWrapper/log/yoga.log"
    exit 1
fi

TMPFILE=$1.grepped
grep "yoga.sh starts" $1 > $TMPFILE

# Tue Mar 23 09:04:44 CET 2010 : yoga.sh starts runDiskFit /var/tmp/php9lLv3W

f="<downloads>"
f=$f$(awk '{print("<d> <y>"$6"</y><m>"$2"</m><file>" $10 "</file></d>")}' $TMPFILE)
f=$f"</downloads>"

echo $f | xml tr --net genDownloads.xsl -s access_log=/home/users/mella/SoftUsage/LITpro/genLITpro.py.out.xml
