home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LANGUAGE / ADA / LOVELACE / mkcomm < prev    next >
Text File  |  1996-10-01  |  738b  |  23 lines

  1. #!/bin/sh
  2. # mkcomm - make the "comments.htm" file
  3. # using files comments.hd, COMMENTS, and comments.tl.
  4. # If there's no file COMMENTS, do nothing.
  5.  
  6. # This script requires the (Unix) Bourne shell.
  7.  
  8. # This script takes file COMMENTS and fixes <, >, and &
  9. # so they'll be okay in a <PRE> .. </PRE> section of an
  10. # HTML document.  If there's an <A HREF="">..</A> on one line,
  11. # that is slipped through as a normal HTML reference.
  12.  
  13. if [ -s COMMENTS ]
  14. then
  15.   cat comments.hd > comments.htm
  16.   sed -e 's/&/\&/g' -e 's/</\</g' \
  17.       -e 's/>/\>/g' \
  18.       -e 's/<\(A HREF="[^"]*"\)>\(.*\)<\/A>/<\1>\2<\/A>/g' \
  19.       -e 's/^From .*/<H3><B>&<\/B><\/H3>/' \
  20.       COMMENTS >> comments.htm
  21.   cat comments.tl >> comments.htm
  22. fi
  23.