nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [nmh-workers] post 1.71 ug: "long line"/single newline paragraphs


From: Ralph Corderoy
Subject: Re: [nmh-workers] post 1.71 ug: "long line"/single newline paragraphs
Date: Sat, 26 May 2018 12:04:27 +0100

Hi Tom,

> >     sed 's/$/\n/' "$@" |
>
> Another idiom is: sed -eG.

Oh yes, that's better.

> >     fmt -su |
>
> Interesting switches for fmt.

Well, I thought you could play around with what you prefer.
It's GNU fmt, which has annoying behaviour.  Bring back _Software Tools_!

    $ yes foo | fmt -60 | uniq -c | sed 3q
         67 foo foo foo foo foo foo foo foo foo foo foo foo foo foo
          3 foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
         67 foo foo foo foo foo foo foo foo foo foo foo foo foo foo
    $ 

The `-u' doesn't turn `foo. Bar' into two spaces, just shortens multiple
spaces to one or two, unfortunately.  On the other hand, `e.g.  gripper'
would then need fixing up.

    $ fmt -u
    Apple   banana  cherry.    Doughnut  eclair.
    ^D
    Apple banana cherry.  Doughnut eclair.
    $ 

I've ~/bin/owpl, one word per line, and fmt does know to use two spaces
when joining lines of different sentences.

    $ owpl | fmt
    Distinct. Lack. Of. Spaces.
    ^D
    Distinct.  Lack.  Of.  Spaces.
    $ 

> >     cat -s

This can be sed too, and it irks to be using an option to cat(1)  :-)
But I go for ease over recall.

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]