Last active
January 7, 2017 20:13
-
-
Save blip-lorist/b97bedf34ddfbacdfffdfbefe54401f9 to your computer and use it in GitHub Desktop.
URL status checker
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
Input: | |
A text file with a URL on each line. Example url-list.txt: | |
http://blah.com | |
http://blah2.com | |
Run: | |
while read url; do curl -I $url 2> /dev/null | head -n1 | awk -v url=$url '{print $2, url}'; done < url-list.txt > link-statuses.txt | |
Output: | |
link-statuses.txt | |
200 http://blah.com | |
404 http://blah2.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment