Skip to content

Instantly share code, notes, and snippets.

@tusbar
Last active August 29, 2015 14:04
Show Gist options
  • Save tusbar/d971f421f77b36b9d63b to your computer and use it in GitHub Desktop.
Save tusbar/d971f421f77b36b9d63b to your computer and use it in GitHub Desktop.
Walk through page redirects
#!/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