awk and condition help

Hi...

i just want to write a script for the follwing command "display status" and the normal output is...

AN100> display status
12.13.2006 12:03:25 AN-2000-1 CC NOT PRESENT 16.50.80.49
status: Status for PACKET GLI A in the TOP / LEFT shelf of frame 0:
status: The current active LAN is A.
status: SCAP Address: 82 067C 80 31 FF
status: DNC number: 1
status: Logical number: 0
AN100>

but i need the output in the format....

frame 0
SCAP Address : 82 067C 80 31 FF

and also if the value of frame is "0" and SCAP Address is "82 067C 80 31 FF" then i need to proceed with the command "reset all"
otherwise echo " DONT PROCEED WITH RESET"

pls help

display status | 
awk ' 
NR == 2 { sub(":","",$NF); print $(NF - 1) , $NF }
NR == 4 { sub("status: ","",$0); print $0 } '  | tee temp

if [ $(sed "N;/.* 0\n.*82 067C 80 31 FF/s//0/" temp) -eq 0 ]
then
    reset all
else
    echo " DONT PROCEED WITH RESET"
fi

hi..

i am getting syntax errors in line 2 and 3.

pls leave the display status assume thw whole conetnts in a file name call abc

then ...

more abc.txt | awk '
NR == 2 { sub(":","",$NF); print $(NF - 1) , $NF }
.......
......
is correct?

If the contents are in file use this

awk ' 
NR == 2 { sub(":","",$NF); print $(NF - 1) , $NF }
NR == 4 { sub("status: ","",$0); print $0 } ' abc.txt

Can you show the error?

cli-079 > awk '
> NR == 2 { sub(":","",$NF); print $(NF - 1) , $NF }
> NR == 4 { sub("status: ","",$0); print $0 } ' abc.txt
awk: syntax error near line 2
awk: illegal statement near line 2
awk: syntax error near line 3
awk: illegal statement near line 3

Try to use nawk if at solaris.