home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / coherent / 6352 < prev    next >
Encoding:
Text File  |  1992-12-21  |  2.8 KB  |  89 lines

  1. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!spool.mu.edu!nigel.msen.com!hela.iti.org!cs.widener.edu!dsinc!phent!kkress
  2. From: kkress@phent.UUCP (Kenneth R. Kress)
  3. Newsgroups: comp.os.coherent
  4. Distribution: world
  5. Subject: mwcbbs contents: explanation of postings
  6. Keywords: mwcbbs contents awk explanation
  7. Message-ID: <9212203750@phent.UUCP>
  8. Organization: That's Entertainment BBS
  9. Date: Sun, 20 Dec 92 13:20:36 EST
  10. Lines: 77
  11.  
  12.     I've posted reformatted versions of the Contents files available
  13. on mwcbbs as of 12/19/92. They are in /rdb form and sorted by date
  14. beginning with the most recent. They can be searched easily with 
  15. awk or grep. 
  16. E.g.,
  17.  
  18. contents.awk "^tin" < 32bit.contents produces:
  19. Filename: tin117.tar.Z
  20. Date: 921210
  21. Size: 331635
  22. Description: Updated tin newsreader from version 1.16
  23. Notes: none
  24. Requirements:  none
  25.  
  26. cat contents.awk produces:
  27. #!/bin/sh
  28. # ---------------------------------------------------------------------    #
  29. #        NAME: contents.awk
  30. #        COPYRIGHT: Copyright 1992 Kenneth R. Kress
  31. #        USAGE: USAGE="usage: $0 pattern < file"
  32. # ---------------------------------------------------------------------    #
  33. USAGE="usage: $0 pattern < file"
  34.  
  35. # ---------------------------------------------------------------------    #
  36. #        DESCRIPTION:
  37. # ---------------------------------------------------------------------    #
  38. # contents.awk - reads a table with columns
  39. #     file    date    size    description    notes    requirements
  40. #    and returns lines matching the pattern. The output format
  41. #    includes descriptive labels and fields are separated by
  42. #     newlines; records are terminated by a blank line.
  43.  
  44.  
  45. # ---------------------------------------------------------------------    #
  46. #        TRAP:
  47. # ---------------------------------------------------------------------    #
  48. TMP=/tmp                # modify to suit
  49.  
  50. echo "$USAGE" > $TMP/$$tmp        # so trap has something to remove
  51. trap "rm -f $TMP/$$*" 0 1 2 3 15
  52.  
  53.  
  54. # #####################################################################    #
  55. #        CODE BEGINS                        #
  56. # ---------------------------------------------------------------------    #
  57.  
  58. awk '
  59. BEGIN {
  60.     FS = "\t"
  61.     ONE = "Filename:"
  62.     TWO = "Date:"
  63.     THREE = "Size:"
  64.     FOUR = "Description:"
  65.     FIVE = "Notes:" 
  66.     SIX = "Requirements: "
  67. }
  68. /'"$1"'/ {
  69.     print ""        # blank line between records
  70.     print ONE, $1
  71.     print TWO, $2
  72.     print THREE, $3
  73.     print FOUR, $4
  74.     print FIVE, $5
  75.     print SIX, $6
  76. }'
  77.  
  78. # ---------------------------------------------------------------------    #
  79. #         CLEAN EXIT
  80. # ---------------------------------------------------------------------    #
  81.  
  82. exit 0
  83. ===================================================================
  84. Ken Kress, Glenside, PA * dsinc!phent!kkress 
  85.     Daring ideas are like chessmen moved forward;
  86.     they may be beaten, but they may start a winning game.
  87.                     Johann Wolfgang von Goethe
  88. -------------------------------------------------------------------
  89.