home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.mail.mh
- Path: sparky!uunet!utcsri!torn!utzoo!utdoe!torag!jrh!jrh
- From: jrh@jrh.uucp (James R. Hamilton)
- Subject: Compact Folders Display
- Message-ID: <1992Nov12.023922.127025@jrh.uucp>
- Organization: private system, Toronto, Ontario
- Date: Thu, 12 Nov 1992 02:39:22 GMT
- Lines: 61
-
- On some of my accounts I have more MH folders than fit on a screen
- at one time. I like to be able to see them all at once so I've
- written a small program that displays 4 on a line in the following
- format:
-
- folder:x>y
-
- where "folder" is the folder name, x is the number of messages in
- the folder and y is the current message number. If folder is the
- current folder then it has a trailing "+" sign. Some example output:
-
-
- archive:0 bdb:32>5 code:24>18 db:1>?
- drafts:0 eval:13>9 faq:28>20 inbox+:1>?
- jrh:3>? logan:33>31 mh:8>7 notes:13>5
- ora:7>? outbox:29>19 rbaker:3>3 uworld:3>1
-
- The program:
-
- #!/bin/sh
- #---------------------------------------------------------------------------
- #
- # FILE: mhfolders
- # Author: James R. Hamilton
- # Date: 92.10.04 @ 20:27:38
- #
- # USAGE: mhfolders
- #
- # DESCRIPTION: Prints out list of mhfolders and the number of messages in
- # in each in a compact 4 column format.
- #
- # COMMENTS/FIXES TO: James Hamilton <jrh@jrh.gts.org>
- #---------------------------------------------------------------------------
-
- AWK=/bin/awk # Set to awk command on system.
- PR=/bin/pr # Set to pr command on system.
- FOLDERS=/usr/local/bin/folders # set to folders command on system.
-
- $FOLDERS $@ |
- $AWK '
- /^$/ { # Stop at first blank line.
- exit
- };
- NR > 1 { # Skip first line.
- if ($3 !~ /no/) # If empty, print 0.
- if (length($9) > 0) # Is there a current msg in the folder?
- printf "%s:%s>%s\n", $1, $3, substr($9,0,length($9)-1);
- else
- printf "%s:%s>?\n", $1, $3;
- else # Not empty, print size.
- printf "%s:0\n", $1;
- }
- ' | $PR -4 -w80 -l1 # Format output into 4 columns.
-
- #
- #------------------------------> End of File <------------------------------
- --
-
- James R. Hamilton inet: jrh@jrh.gts.org
- telephone: +1 416 493 4162 uunet: ...!uunet!jrh!jrh
- Toronto, Canada work: jrh@torolab6.vnet.ibm.com
-