In my current job I often have to work with files from Windows machines which most of the time isn't a big deal, but when piping a side-by-side diff to less, not only are the ^M being displayed, but it also messes up the indentation, like in the following:<U+FEFF>using System;^M                                 <U+FEFF>using System;^M                                 using System.Reflection;^M                                      using System.Reflection;^M                                      using System.Runtime.Serializa^M                                        using System.Runtime.Serializa^M                                        using System.Transactions;^M                                    using System.Transactions;^M                                    (I don't particularly mind the UTF-8 BOM in the first line, as it affects only that one line.)I know I can do adiff -y <(tr -d '\015' < file-a) <(tr -d '\015' < file-b) | lessBut that's a heck of a lot to type, and when file-a and file-b share a long path, you can't use bash's curly braces nicety. Anddiff -y file-{a,b} | tr -d '\015' | lessdoes not do the trick, as the formatting is already messed up.Interestingly though, the following displays fine both in terms of ^M and indentation:diff -y file-{a,b} | headSo my question is, how do I get side-by-side diffs piped into less without the aforementioned issues? (Like adding some parameter to diff or less that I'm not aware of)
`diff -y file-{a,b} | less` and DOS line endings display issues
diff;less;newlines