Last active
December 16, 2015 16:29
-
-
Save willtonkin/5463572 to your computer and use it in GitHub Desktop.
Iterate through a list of URLs returning their HTTP response and showing their resultant redirect location. Been used for redirect testing.
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 | |
#BASE=example.com | |
while read LINE; do | |
echo -n "$BASE$LINE" | |
curl -o /dev/null --silent --head --write-out ' : %{http_code} -> ' "$BASE$LINE" | |
curl -IL -o /dev/null --silent --head --write-out '%{url_effective} : %{http_code}\n' "$BASE$LINE" | |
done < url-list.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment