Check URLs in .xml file for 404s

revision 489f69a0040d265c0710bffab7e5e541047ca4d5

raw

code.sh

1
2
3
4
5
6
7
8
#!/bin/sh
# URLs are values of the tags "lthumb" and "photo"
# If they have a non-200 status code they will be printed out
xmlstarlet sel -t -v '//lthumb|//photo' file.xml\
    | grep -v '^$'\
    | xargs -L1 curl -I --silent --output /dev/null -w '%{http_code} %{url_effective}\n'\
    | grep -v ^200
 

History