Created
March 16, 2023 15:41
-
-
Save Blake-/319d57679db39618a49decf322415ba4 to your computer and use it in GitHub Desktop.
Shell script that returns http code from a list of sites
This file contains hidden or 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 | |
INPUT=sites.txt | |
OLDIFS=$IFS | |
IFS=, | |
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; } | |
while read SITE | |
do | |
curl -o /dev/null --silent --head --write-out '%{url_effective},%{http_code}\n' $SITE | |
sleep 1 | |
done < $INPUT | |
IFS=$OLDIFS | |
echo -e "Done :-)\n\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment