Last active
August 29, 2015 14:04
-
-
Save tusbar/d971f421f77b36b9d63b to your computer and use it in GitHub Desktop.
Walk through page redirects
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
#!/usr/bin/env sh | |
url="$1" | |
while [ "$url" ]; | |
do | |
code=$(curl -I -s -o /dev/null -w "%{http_code}" "$url") | |
url=$(curl -I -s -o /dev/null -w "%{redirect_url}\n" "$url") | |
echo "$code $url" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment