[ Script ]
daniel@black ~/Tools$ cat getIp
#!/bin/bash
#
# A quick script I whipped up
# to tell me my IP address.
#
# It simply Wget's the index
# page from ipchicken.com,
# looks for a unique place
# holder and then continues
# to single out the IP address.
#
# By Danny [September of 2007]
wget www.ipchicken.com
cat index.html | grep -A 1 'color="#0000FF"><b>' | awk '{print $1}' > tempOut
cat tempOut | awk -F '<p' '{print $1}' | sed -e '1,1d' > final
rm index.* tempOut
clear
echo "Your IP address is: `cat final`"
rm final
# Done :-)
daniel@black ~/Tools$
[ Output ]
Your IP address is: 66.xxx.xx.146
daniel@black ~/Tools$