All pastes #718264 Raw Edit

Mine

public text v1 · immutable
#718264 ·published 2007-09-28 07:51 UTC
rendered paste body
[ 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$