Path: utzoo!attcan!utgpu!trigraph!john From: john@trigraph.uucp (John Chew) Newsgroups: comp.mail.misc Subject: sed script to summarize mailbox Message-ID: <1989Dec7.220405.22185@trigraph.uucp> Date: 7 Dec 89 22:04:05 GMT Sender: "John J. Chew" Reply-To: "John J. Chew" Organization: Trigraph Inc., Toronto, Canada Lines: 39 A few days ago I got tired of waiting for /usr/ucb/from to waddle its way through my mailbox every time I logged on, browsed through the source, and when the nausea subsided, wrote the following sed script. Cut it, save it as from.sed, and invoke it (most likely through a shell alias) with 'sed -n -f from.sed YOUR-MAILBOX-NAME'. The script searches for lines beginning "From ", swaps date and sender, truncates or pads sender to ten characters, searches for and appends the subject and prints all three on a line. Yeah, it's obvious, but it took me a few years to think of doing it, so it might save a few netperson-years out there. Comments, criticisms, suggestions, etc. welcome. John ----- BEGIN from.sed # from.sed - summarize messages in a mailbox # $Header: from.sed,v 1.1 89/12/07 16:49:52 john Rel $ # Copyright (C) 1989 John J. Chew, III # you may distribute this file freely as long as you do not change it /^From /!d s/// s/^[^ ]*!\([^ !]*\) /\1 / s/^\([^ @]*\)@[^ ]* /\1 / s/ / / s/^\(..........\)[^ ]* *\(.*\)/\2 \1/ h : loop n /^$/b /^Subject:/!b loop H g s/\nSubject: */ /p ----- END from.sed ----- -- john j. chew, iii phone: +1 416 425 3818 AppleLink: CDA0329 trigraph, inc., toronto, canada {uunet!utai!utcsri,utgpu,utzoo}!trigraph!john dept. of math., u. of toronto poslfit@{utorgpu.bitnet,gpu.utcs.utoronto.ca}