Montag, 6. Mai 2013

Replacing Ctrl+M with newline

Differences in line endings (CR vs CR+LF vs ...) are a constant PITA. Here's one quick hack I used to fix some Haskell source code copied from StackOverflow and pasted via pbpaste:

cat udp_syslog_server.hs | tr "[^M]" "[\n]"

Keine Kommentare:

Kommentar veröffentlichen