^M line endings

Jon LaBadie mutter at jgcomp.com
Thu Oct 26 06:12:44 UTC 2023


On Fri, Oct 20, 2023 at 01:08:31PM -0700, googly.negotiator862 at aceecat.org wrote:
>On Fri, Oct 20, 2023 at 12:43:42PM +0200, Ralf Hildebrandt via Mutt-users wrote:
>
>> I'm getting a few mails which use "^M" line endings, which mutt
>> seems to ignore when displaying the body of the email.
>
>> How can I make mutt properly display the mail.
>
>My immediate reaction is you'll need an external filter like maybe
>tofrodos, although I don't know if tofrodos specifically can handle CR
>only input -- as opposed to CRLF.
>
If you can filter the message the translate command, tr(1)
may be useful.

If you have only the CR (^M, aka \r) tr can convert it to
the LF character (^J, aka \n)

   tr '\r' '\n'

Should you try this and your text becomes double spaced
with blank lines, you had both CR and LF present.  In
that case use tr to delete the CR from the original msg..

   tr -d '\r'

-- 
Jon H. LaBadie                 jon at labadie.us
  154 Milkweed Dr                 (540) 868-8052 (H)
  Lake Frederick, VA 22630        (703) 935-6720 (M)



More information about the Mutt-users mailing list