coreutils
[Top][All Lists]
Advanced

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

Re: Question about fold


From: Pádraig Brady
Subject: Re: Question about fold
Date: Fri, 29 Jul 2022 20:10:06 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Thunderbird/98.0

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

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