Shell script to manipulate a file

Hello,

I have a file with following contents :

WSL SRVGRP=LISTENER SRVID=2
CLOPT="-A -t -- -n 0x0002aa050a03cc65 "
RQPERM=0660 REPLYQ=Y RPPERM=0660
MIN=1 MAX=1 CONV=N

I need to print only the value in Hex i.e. 0x0002aa050a03cc65 using shell script.

awk '{ for(i=1; i<=NF; i++) { if(substr($i,1,2)=="0x"){print $i}   }   } ' inputfile > newfile
 grep -o '0x.[^ \t]*' file