parse text file

i am attempting to parse a simple text file with multiple lines and four fields in each line, formatted as such:

12/10/2006 12:34:06 77 38

this is what i'm having problems with in my bash script:

sed '1,6d' $RAWDATA > $NEWFILE
#removes first 6 lines from file, which are headers/unneeded
mv $RAWDATA $BACKUP
#saves untouched data file to backup
mv $NEWFILE $RAWDATA
#repositions data file (minus the 6 header lines) to the orginal filename
sed 144q $RAWDATA > $NEWFILE
#we only want the first 144 lines
sed = $NEWFILE | sed 'N;s/\n/\=/' > $RAWDATA
#number the lines (not sure if this is needed)
CURTEMP=`awk '/${LINENUM}=/ {print $3}' $RAWDATA`

everything works up until the last line. $LINENUM is set previously to 1 (first line). i'm brand new to scripting and 'awk' so i've probably screwed this all up. when i do the awk cmd from the command line without the variables it works. but when i run the script, this line return CURTEMP as blank.
the command line i use is
awk '/133=/ {print $3}' data.txt
and that works fine.. so not exactly sure where i went wrong, i just know that i went wrong. hopefully ya'll can straighten me out on this. thanks in advance

When you pass shell script variables to awk use one of these

CURTEMP=`awk '/"'"${LINENUM}"'"=/ {print $3}' $RAWDATA` 

or

CURTEMP=`awk -v num=${LINENUM} ' $0 ~ num"=" {print $3}' $RAWDATA`

thanks! I tried both, the first option did not work. the second option got me a result, but it spits out 15 lines, instead of just one. what i need the script to do is this
read 1st line, take third field which is temperature
read 2nd line, take third field, compare to result from previous line, if higher, mark as MAX and move on to next line, if lower, just move on to next line.
read 3rd line, take third field, compare to result from previous line, if higher, mark as MAX and move on to next line, if lower, just move on to next line
etc... all the way through line 144 which would be the last line in the file. i have the script set to number the lines as such
1=time date temp humidity
2=time date temp humidity
....
144=time date temp humidity

any help is appreciated.. thank you!

What do you mean by "mark as MAX" ?