home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / coherent / 6937 < prev    next >
Encoding:
Text File  |  1993-01-25  |  2.8 KB  |  98 lines

  1. Path: sparky!uunet!usc!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: Explanation of mwcbbs listing (which follows)
  6. Keywords: mwcbbs file listing
  7. Message-ID: <9301245344@phent.UUCP>
  8. Organization: That's Entertainment BBS
  9. Date: Sun, 24 Jan 93 21:50:08 EST
  10. Lines: 86
  11.  
  12.     I've posted reformatted versions of the Contents files on
  13. mwcbbs as of 1/24/93. 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. contents.awk "^tin" < 32bit.contents produces:
  18.  
  19. Filename: tin118.zip
  20. Date: 930105
  21. Size: 349942
  22. Description: newreader package
  23. Notes: none
  24. Requirements:  none
  25.  
  26. Filename: tin117.tar.Z
  27. Date: 921210
  28. Size: 331635
  29. Description: Updated tin newsreader from version 1.16
  30. Notes: none
  31. Requirements:  none
  32.  
  33. cat contents.awk produces:
  34.  
  35. #!/bin/sh
  36. # ---------------------------------------------------------------------    #
  37. #        NAME: contents.awk
  38. #        COPYRIGHT: Copyright 1992 Kenneth R. Kress
  39. #        USAGE: "USAGE: $0 pattern < file"
  40. # ---------------------------------------------------------------------    #
  41. USAGE="USAGE: $0 pattern < file"
  42.  
  43. # ---------------------------------------------------------------------    #
  44. #        DESCRIPTION:
  45. # ---------------------------------------------------------------------    #
  46. # contents.awk - reads a table with columns
  47. #     file    date    size    description    notes    requirements
  48. #    and returns lines matching the pattern. The output format
  49. #    includes descriptive labels and fields are separated by
  50. #     newlines; records are terminated by a blank line.
  51.  
  52.  
  53. # ---------------------------------------------------------------------    #
  54. #        TRAP:
  55. # ---------------------------------------------------------------------    #
  56. TMP=/tmp                # modify to suit
  57.  
  58. echo "$USAGE" > $TMP/$$tmp        # so trap has something to remove
  59. trap "rm -f $TMP/$$*" 0 1 2 3 15
  60.  
  61.  
  62. # #####################################################################    #
  63. #        CODE BEGINS                        #
  64. # ---------------------------------------------------------------------    #
  65.  
  66. awk '
  67. BEGIN {
  68.     FS = "\t"
  69.     ONE = "Filename:"
  70.     TWO = "Date:"
  71.     THREE = "Size:"
  72.     FOUR = "Description:"
  73.     FIVE = "Notes:" 
  74.     SIX = "Requirements: "
  75. }
  76. /'"$1"'/ {
  77.     print ""        # blank line between records
  78.     print ONE, $1
  79.     print TWO, $2
  80.     print THREE, $3
  81.     print FOUR, $4
  82.     print FIVE, $5
  83.     print SIX, $6
  84. }'
  85.  
  86. # ---------------------------------------------------------------------    #
  87. #         CLEAN EXIT
  88. # ---------------------------------------------------------------------    #
  89.  
  90. exit 0
  91.  
  92. ===================================================================
  93. Ken Kress, Glenside, PA * dsinc!phent!kkress 
  94.     Daring ideas are like chessmen moved forward;
  95.     they may be beaten, but they may start a winning game.
  96.                     Johann Wolfgang von Goethe
  97. -------------------------------------------------------------------
  98.