Line-end agnostic diff?

后端 未结 7 1757
醉梦人生
醉梦人生 2021-01-01 14:19

I\'m working on a Mac, with some fairly old files. Different files were created by different programs, so some of them end with \\r (Mac) and some with \\n (Unix). I want to

7条回答
  •  既然无缘
    2021-01-01 14:38

    The diff utility bundled with OS X v10.7 (Lion) has an option 'strip-trailing-cr' that does that you want. You use it like so:

    diff -cpt a.c b.c --strip-trailing-cr
    

提交回复
热议问题