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