Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]tlug: Re: awk (was tcl/tk + sed, was bash)
- To: tlug@example.com
- Subject: tlug: Re: awk (was tcl/tk + sed, was bash)
- From: Jason Molenda <crash@example.com>
- Date: Thu, 27 Mar 1997 23:46:13 +0900 (JST)
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=US-ASCII
- In-Reply-To: <XFMail.970327201202.schweiz@example.com> from "Jim Schweizer" at Mar 27, 97 08:05:21 pm
- Reply-To: tlug@example.com
- Sender: owner-tlug
-------------------------------------------------------- tlug note from Jason Molenda <crash@example.com> -------------------------------------------------------- Jim S wrote: > Just thought I'd pass along this quick hack into Tcl/Tk I did for > the earlier bash question - not too useful but it was fun... Well my fragile ego won't have any of that! This handles multiple messages in one input stream. It either takes stdin or filenames on the command line. It eats up whitespace at the beginning of messages. It isn't particularly pretty, or useful. :-) Jason ================================================== #! /bin/sh # ignores the Content-Length: header, assumes messages start with "From_". # would be easy to have it print out the sender at the top of the message--just # look for ^From: while inheader and save the string until we're no longer in # the e-mail header. awk '{ if ($1 == "From") { inheader = 1 # we are in the header of an e-mail message continue } if (inheader) { if (NF == 0) # blank line { eatblanks = 1 continue } if (eatblanks && NF > 0) # start of actual message text { if (morethanone) # print ^L iff we have more than one msg { print "" } print inheader = 0 # we are no longer in the e-mail header eatblanks = 0 morethanone = 1 } continue # skip this header line } print }' $* | lpr ----------------------------------------------------------------- a word from the sponsor will appear below ----------------------------------------------------------------- The TLUG mailing list is proudly sponsored by TWICS - Japan's First Public-Access Internet System. Now offering 20,000 yen/year flat rate Internet access with no time charges. Full line of corporate Internet and intranet products are available. info@example.com Tel: 03-3351-5977 Fax: 03-3353-6096
- References:
- tlug: Tcl/Tk + sed (was bash?)
- From: Jim Schweizer <schweiz@example.com>
Home | Main Index | Thread Index
- Prev by Date: tlug: Tcl/Tk + sed (was bash?)
- Next by Date: tlug: Locale
- Prev by thread: tlug: Tcl/Tk + sed (was bash?)
- Next by thread: tlug: Locale
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links