home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!paladin.american.edu!darwin.sura.net!spool.mu.edu!nigel.msen.com!hela.iti.org!cs.widener.edu!dsinc!phent!kkress
- From: kkress@phent.UUCP (Kenneth R. Kress)
- Newsgroups: comp.os.coherent
- Distribution: world
- Subject: mwcbbs contents: explanation of postings
- Keywords: mwcbbs contents awk explanation
- Message-ID: <9212203750@phent.UUCP>
- Organization: That's Entertainment BBS
- Date: Sun, 20 Dec 92 13:20:36 EST
- Lines: 77
-
- I've posted reformatted versions of the Contents files available
- on mwcbbs as of 12/19/92. They are in /rdb form and sorted by date
- beginning with the most recent. They can be searched easily with
- awk or grep.
- E.g.,
-
- contents.awk "^tin" < 32bit.contents produces:
- Filename: tin117.tar.Z
- Date: 921210
- Size: 331635
- Description: Updated tin newsreader from version 1.16
- Notes: none
- Requirements: none
-
- cat contents.awk produces:
- #!/bin/sh
- # --------------------------------------------------------------------- #
- # NAME: contents.awk
- # COPYRIGHT: Copyright 1992 Kenneth R. Kress
- # USAGE: USAGE="usage: $0 pattern < file"
- # --------------------------------------------------------------------- #
- USAGE="usage: $0 pattern < file"
-
- # --------------------------------------------------------------------- #
- # DESCRIPTION:
- # --------------------------------------------------------------------- #
- # contents.awk - reads a table with columns
- # file date size description notes requirements
- # and returns lines matching the pattern. The output format
- # includes descriptive labels and fields are separated by
- # newlines; records are terminated by a blank line.
-
-
- # --------------------------------------------------------------------- #
- # TRAP:
- # --------------------------------------------------------------------- #
- TMP=/tmp # modify to suit
-
- echo "$USAGE" > $TMP/$$tmp # so trap has something to remove
- trap "rm -f $TMP/$$*" 0 1 2 3 15
-
-
- # ##################################################################### #
- # CODE BEGINS #
- # --------------------------------------------------------------------- #
-
- awk '
- BEGIN {
- FS = "\t"
- ONE = "Filename:"
- TWO = "Date:"
- THREE = "Size:"
- FOUR = "Description:"
- FIVE = "Notes:"
- SIX = "Requirements: "
- }
- /'"$1"'/ {
- print "" # blank line between records
- print ONE, $1
- print TWO, $2
- print THREE, $3
- print FOUR, $4
- print FIVE, $5
- print SIX, $6
- }'
-
- # --------------------------------------------------------------------- #
- # CLEAN EXIT
- # --------------------------------------------------------------------- #
-
- exit 0
- ===================================================================
- Ken Kress, Glenside, PA * dsinc!phent!kkress
- Daring ideas are like chessmen moved forward;
- they may be beaten, but they may start a winning game.
- Johann Wolfgang von Goethe
- -------------------------------------------------------------------
-