Skip to content

Instantly share code, notes, and snippets.

@PeteLawrence
Created September 26, 2014 13:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PeteLawrence/dfbe2c9a51bc6b1c467e to your computer and use it in GitHub Desktop.
Save PeteLawrence/dfbe2c9a51bc6b1c467e to your computer and use it in GitHub Desktop.
Simple URL checker
#!/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