Comparison of 2 sun server patches using script

Hi,

I am not sure what I am missing, tried to debug but was not successful, any help on this will be much appreciated.

#!/bin/sh
rm -f /tmp/t?
host1=`cat $1|grep Hostname: | awk '{print $2}'`
host2=`cat $2|grep Hostname: | awk '{print $2}'`
rel1=`cat $1|grep Release: | awk '{print $2}'`
rel2=`cat $2|grep Release: | awk '{print $2}'`
arch1=`cat $1|grep "Kernel architecture:" | awk '{print $3}'`
arch2=`cat $2|grep "Kernel architecture:" | awk '{print $3}'`

cat $1 |grep "Patch:" | awk '{print $2}'  >/tmp/t1
cat $2 |grep "Patch:" | awk '{print $2}'  >/tmp/t2

cat /tmp/t1 | awk '{print $1}'| sort  >/tmp/t3
cat /tmp/t2 | awk '{print $1}'| sort  >/tmp/t4

prev=`head -1 t3`
for  i in `cat t3`
do
        curr=$i
        if [ $prev != $curr ]
        then
                currhead=`echo $curr | cut -f 1 -d "-"`
                prevhead=`echo $prev | cut -f 1 -d "-"`
                if [ $prevhead != $currhead ]
                then
                        echo $prev >> /tmp/ta
                fi
                prev=$curr
        fi
done

rm /tmp/t?

When I execute this I get the following output, and stucks there itself.

$ ./patchscript
+ rm -f /tmp/t?
+ cat
+ grep Hostname:
+ awk {print $2}

Please post the content of the two input files ($1 and $2) and explain what you want to achieve.