$ wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
These two are from Aaron B. The first one (ftp -V -o - http://ip.qbit.io) works with base OpenBSD and FreeBSD with zero external dependencies! The second one needs 'curl'.
$ ftp -V -o - http://ip.qbit.io
$ curl ifconfig.me
You can find a few more at http://www.commandlinefu.com/commands/view/5427/get-your-external-ip-address