need help parsing text file
I'm trying to use BASH to extract an IP address from my router using the web interface of my router. The text from the router's page is as follows:
[shim.gif] Subnet mask
[shim.gif] Wan IP
[shim.gif] Default gateway
[shim.gif] DNS Address
I want to extract the IP (22.214.171.124) on the line right under the text "Wan IP". I can get almost there with lynx x.x.x.x -dump | grep "Wan IP", but the IP is on the line after the text...
So how can I parse a text file/output to find all the text AFTER the token "Wan IP[return][space][space][space]" up to but not including the token "[return]"?
I'm sure this isn't a difficult grep/cut/awk problem, but I'm having difficulty getting to my end product here.
Thank in advance for any help that can be provided...