home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / forut062.zip / ForUtil-0.62 / man / add_urls.sh next >
Linux/UNIX/POSIX Shell Script  |  1996-08-21  |  746b  |  32 lines

  1. #!/bin/sh
  2. #
  3. # add_urls.sh: add cross references to the html pages outputted by man2html
  4. #
  5. # set this to 1 if you want output
  6. verbose=0
  7. if [ "$verbose" = "1" ]; then
  8.     echo -n "Adding HTML crossreferences: "
  9. fi
  10. for file in html/*.html ; do
  11.     curr_file=`basename $file .html`
  12.     if [ "$verbose" = "1" ]; then
  13.         echo -n "$curr_file.html "
  14.     fi
  15.     tmp_cache=$curr_file.cache
  16.     for html_page in html/*.html ; do
  17.         this_file=`basename $html_page .html`
  18.         if [ ! "$curr_file" = "$this_file" ] ; then
  19. cat >> $tmp_cache << !EO_CACHE
  20. s@<STRONG>$this_file</STRONG>@<a href="$this_file.html">$this_file</a>@
  21. !EO_CACHE
  22.         fi
  23.     done
  24.     cp $file temp.html
  25.     sed -f $tmp_cache temp.html > $file
  26.     rm temp.html
  27.     rm $tmp_cache
  28. done
  29. if [ "$verbose" = "1" ]; then
  30.     echo "done"
  31. fi
  32.