#!/bin/sh # showlink # 19991012 ** 1st version # # a bash+find+egrep+sed utility to webdesigners. # showlink shows all kind of links on a web site. # it gets all *html pages above the current dir. # you can parse its output to find lost links, do # statistics, find errors, or just for curiosity &:) # # a quick example: # cp showlink /bin ; cd /home/httpd/html ; showlink -a Usage(){ echo "$0 OPTION (just one option) -a,--all all links found -c,--chk check for incorrect links -d,--dir links that point to directories -e,--email links that point do emails (mailto:) -f,--ftp links that point do external pages (ftp://) -h,--http links that point do external pages (http://) -i,--image links that point do images -m,--music links that point do music files -p,--page links on the same page -z,--zzz links marked with ??? (todo link) --help this help UPPERCASE single option (-[ACDEFHIMPZ]) give the output without the filename. i.e. \"`basename $0` -A\" " ; exit 1 } [ "$1" ] || Usage OPT=$1 ### the defaults for full output - do NOT edit! # the delimiter beetween the filename and the link found D=':' # options passed to the egrep command. this is related to # case of the option passed on the command line. lowercase # is the default: show filename (H option). uppercase # supresses it. EGREP_OPTS='-His' # the egrep pattern is only 'href=' and not '