I need to get the final URL after a page redirect preferably with curl or wget.
For example http://google.com may redirect to http://www.google.com
This would work:
curl -I somesite.com | perl -n -e '/^Location: (.*)$/ && print "$1\n"'