You can use http://ipecho.net/plain with
curl. I'm sure there are many, many others you could use it with too...
lynx --dump ipecho.net/plain
- --dump tells
lynx to download the page and display it on stdout.
wget -q -O - ipecho.net/plain
- -q means quiet (i.e. do not display download progress).
- -O tells
wget where to write the output to. The dash after it means stdout.
You can also use http://www.whatismyipaddress.com easily enough with
lynx --dump whatismyipaddress.com | grep "Your IP"
...and if you're really desperate, you're sure to be able to do it this rediculously complex way!
echo -en "GET /plain HTTP/1.1\nHOST: ipecho.net\n\n" >&3
Output looks something like this...
HTTP/1.1 200 OK
Date: Sat, 28 Sep 2013 14:59:07 GMT
Expires: Mon, 26 Jul 1997 05:00:00 GMT