git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: CRLF, LF ... CR ?

From
JBJens Bauer <jens-lists@gpio.dk>
Date
Sep 13, 2012, 19:13 UTC
Message-ID
<20120913211355575954.3979105b@gpio.dk>
In-Reply-To
<50522720.50204@kdbg.org>
Hi Johannes.
I've changed...
	tr '\\r' '\\n'
...to...
	tr '\\15' '\\12'

...As you are right in that it is more correct. (Then in theory, it would be portable). [I once came across tftpd, tried compiling it on a Mac, but it failed to work, because \r and \n were swapped on the compiler, so I asked the author to use \15 and \12, which made it fully portable]

It now works even better. I can't and won't complain - thank you. =)

Love Jens

On Thu, 13 Sep 2012 20:34:08 +0200, Johannes Sixt wrote:
Show 23 quoted lines
> Am 13.09.2012 17:53, schrieb Jens Bauer:
>> Hi Jeff and Drew.
>> 
>> Thank you for your quick replies! :)
>> 
>> The diffs look nasty yes; that's my main issue.
>> It can be worked around in many ways; eg a simple (but time consuming) way:
>> $ git diff mypcb.osm >mypcb.diff && nano mypcb.diff
>> 
>> -It'd be better to just pipe it into a regex, which changes CR to LF 
>> on the fly.
>> 
>> OsmondPCB is able to read files that has mixed LF and CR. (By mixed, 
>> I do not talk about CRLF)
> 
> That is good news. Just write a 'clean' filter that amounts to
> 
>    tr '\015' '\012'
> 
> You don't need a 'smudge' filter that reverts this conversion.
> 
> -- Hannes
> 
Previous: Johannes SixtNext: Erik Faye-Lund
Message 9 of 18 in “CRLF, LF ... CR ?”
  1. Jens BauerSep 13, 2012
  2. Drew NorthupSep 13, 2012
  3. Jeff KingSep 13, 2012
  4. Jens BauerSep 13, 2012
  5. Jens BauerSep 13, 2012
  6. Jeff KingSep 13, 2012
  7. Jens BauerSep 13, 2012
  8. Johannes SixtSep 13, 2012
  9. Jens BauerSep 13, 2012
  10. Erik Faye-LundSep 13, 2012
  11. David AguilarSep 14, 2012
  12. Jens BauerSep 14, 2012
  13. Junio C HamanoSep 14, 2012
  14. David AguilarSep 26, 2012
  15. Jens BauerSep 26, 2012
  16. Jens BauerSep 26, 2012
  17. Junio C HamanoSep 27, 2012
  18. Jens BauerSep 27, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.