#! /bin/csh -f

set lib = "${STOLFIHOME}/lib"

sed \
  -e 's/[bB][aA][sS][eE] *= */><base=/g' \
  -e 's/[hH][rR][eE][fF] *= */><href=/g' \
  -e 's/[sS][rR][cC] *= */><src=/g' \
  -e 's/[uU][rR][lL] *= */><url=/g' \
  -e 's/[bB][aA][cC][kK][gG][rR][oO][uU][nN][dD] *= */><background=/g' \
  -e 's/="\([^" >]*\)[" ]*/="\1"></g' \
  -e 's/=[ ]*\([^" >][^" >]*\)[" ]*/="\1"></g' \
| tr '<>' '\012\012' \
| egrep 'href=|src=|base=|url=|background=' \
| grep -v '="#' \
| sed \
  -e 's/[a-z][a-z]*="//g' \
  -e 's/" *$//g' \
| sort -u
