home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume20 / index-db / part01 / samples / books.fmt next >
Encoding:
Text File  |  1989-10-23  |  616 b   |  50 lines

  1. #!/bin/sh
  2. #
  3. # books.fmt - format the books database into a nice troff-able list
  4. #
  5.  
  6. #
  7. # Put out troff header (set point size, etc.)
  8. #
  9. cat << EOF
  10. .\"
  11. .\" Run me off with "tbl | troff -ms"
  12. .\" Then use "psdit -p/land.pro"
  13. .\"
  14. .nr LL 10.25i
  15. .nr PO .25i
  16. .nr HM .5i
  17. .nr FM .5i
  18. .nr PS 6
  19. .nr VS 8
  20. .ll 10.25i
  21. .po .25i
  22. .pl 8.5i
  23. .ps 6
  24. .vs 8
  25. .OH "''%'\*(DY'"
  26. .EH "''%'\*(DY'"
  27. .ND
  28. .P1
  29. .2C
  30. .TS H
  31. c c c c c
  32. l l l l c.
  33. EOF
  34.  
  35. #
  36. # Let awk handle reformatting.
  37. #
  38. awk    'BEGIN    { FS = "\t" }
  39.         { printf "%s\t%s\t%s\t%s\t%s\n", $1, $2, $3, $4, $5
  40.           if (NR == 1)
  41.             printf "=\n.TH\n"
  42.         }'
  43.  
  44. #
  45. # Put out troff footer.
  46. #
  47. cat << EOF
  48. .TE
  49. EOF
  50.