Skip to content

Instantly share code, notes, and snippets.

@nichtich
Created February 3, 2014 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nichtich/8791809 to your computer and use it in GitHub Desktop.
Save nichtich/8791809 to your computer and use it in GitHub Desktop.
simple linkchecker script
#!/bin/bash
if [ "$#" -eq 0 ]; then
echo "please provide an URL to check links at!" >&2
exit 1
fi
URL=$1
wget --spider -H -r -l1 $URL 2>&1 \
| perl -ane '$url=$F[2] if /^--/; print "$url $1\n" if / ([0-9]{3} [A-Z ]+)$/i;'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment