[CentOS] Need to split long lines in mail archives

Mon Apr 9 17:41:05 UTC 2012
fred smith <fredex at fcshome.stoneham.ma.us>

On Mon, Apr 09, 2012 at 01:09:59PM -0400, James B. Byrne wrote:
> CentOS-6.2
> 
> I am investigating how to split long lines present in a
> Mailman generated html archives.  Mailman places the email
> bodies within <pre></pre> tags and some users have MUAs
> that send entire paragraphs as one long line.
> 
> I have looked at fmt and fold but these assume a pipeline
> from stdout to a fixed filename, which presumably is best

fold reads stdin and writes stdout. I have a script I use all
the time that depends on that, so I know it works that way.

here's an excerpt from "man fold" on my system:

FOLD(1)                          User Commands                         FOLD(1)

NAME
       fold - wrap each input line to fit in specified width

SYNOPSIS
       fold [OPTION]... [FILE]...

DESCRIPTION
       Wrap input lines in each FILE (standard input by default), writing to standard output.


-- 
---- Fred Smith -- fredex at fcshome.stoneham.ma.us -----------------------------
               But God demonstrates his own love for us in this: 
                         While we were still sinners, 
                              Christ died for us.
------------------------------- Romans 5:8 (niv) ------------------------------