Created
March 15, 2010 18:17
-
-
Save dsc/333119 to your computer and use it in GitHub Desktop.
unshorten.sh -- undo tiny-ing, bitly-ing, shady-ing, etc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage: | |
# unshorten.sh 'http://bit.ly/95U1UY' | |
# echo 'http://bit.ly/95U1UY' | unshorten.sh | |
# | |
# author: [email protected] | |
if test "$1"; then | |
url="$1" | |
else | |
read url | |
fi | |
curl -I -s "$url" | fgrep 'Location:' | cut -d ' ' -f 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment