On 29/07/2022 07:25, Moritz Poldrack wrote:
Hello,

I want to use fold to wrap plaintext emails that are not wrapped
properly, I've run into an issue where, when run with -s, links that
exceed the maximum width are still wrapped and therefore break. Is this
intended behaviour?

For example
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.

        
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes

processed using fold -w 20 -s test.txt results in
        Lorem ipsum dolor
        sit amet,
        consectetur
        adipiscing elit.

        https://www.kernel.o
        rg/doc/html/latest/p
        rocess/submitting-pa
        tches.html#describe-
        your-changes

which is unexpected since a forced cutoff is not mentioned in the
manpage. Am I missing something or is there a way to achieve that?

Both fold and fmt have overlapping functionality.
fold is more lower level, using less context,
and is operating as expected in this case.

`fmt -w 20` may be more appropriate for your needs.

thanks,
Pádraig

Reply via email to