Created
September 26, 2014 13:26
-
-
Save PeteLawrence/dfbe2c9a51bc6b1c467e to your computer and use it in GitHub Desktop.
Simple URL 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
#!/bin/bash | |
# | |
# Checks the status of a file full of urls | |
# Usage: ./urlchecker.sh urls.txt | |
# | |
echo "" > urlstatus.txt | |
while read url | |
do | |
urlstatus=$(curl -o /dev/null --silent --head --write-out '%{http_code}' "$url" ) | |
echo "$url $urlstatus" >> urlstatus.txt | |
done < $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment