#78 Reporting Broken External Links

This partner script to Script #77, Identifying Broken Internal Links, utilizes the -traversal option of lynx to generate and test a set of external links — links to other websites. When run as a traversal of a site, lynx produces a number of data files, one of which is called reject.dat. The reject.dat file contains a list of all external links, both website links and mailto: links. By iteratively trying to access each http link in reject.dat, you can quickly ascertain which sites work and which sites fail to resolve, which is exactly what this script does.

The Code

 #!/bin/sh # checkexternal - Traverses all internal URLs on a website to build a # list of external references, then checks each one to ...

Get Wicked Cool Shell Scripts now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.