Skip to content

Instantly share code, notes, and snippets.

@Guzzter
Created September 3, 2015 13:59
Show Gist options
  • Save Guzzter/710ae2aca29d09bf9ae6 to your computer and use it in GitHub Desktop.
Save Guzzter/710ae2aca29d09bf9ae6 to your computer and use it in GitHub Desktop.
Bash script to test url and log the http response codes
#!/bin/sh
input=list.txt
output=urls_result.txt
siteprefix=https://www.site.com
rm -rf $output
while read LINE
do
url=$siteprefix${LINE:1}
echo Processing $url
curl -o /dev/null --silent --progress-bar --head --write-out '%{http_code} %{url_effective}\n' "$url" >> $output
done < "$input"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment