Skip to content

Instantly share code, notes, and snippets.

@Erikdekamps
Last active March 20, 2017 11:36
Show Gist options
  • Save Erikdekamps/4b213ba345cff662af16dfa24553c34f to your computer and use it in GitHub Desktop.
Save Erikdekamps/4b213ba345cff662af16dfa24553c34f to your computer and use it in GitHub Desktop.
cURL - Get http codes from list of urls
#!/bin/bash
while read LINE; do
# cURL the url and write to file.
curl -o /dev/null --silent --progress-bar --head --write-out '%{http_code} | %{url_effective}\n' "$LINE" >> result.txt
# Echo the line in terminal.
echo "$LINE"
# The file name below.
done < urls.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment