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:
[snip]
...
PPPoE
[shim.gif] [32]Subnet mask
1.1.1.1
[shim.gif] [33]Wan IP
2.2.2.2
[shim.gif] [34]Default gateway
3.3.3.3
[shim.gif] [35]DNS Address
...
[snip]
I want to extract the IP (2.2.2.2) 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...
|