Line-end agnostic diff?

后端 未结 7 1722
醉梦人生
醉梦人生 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:48

    I used the following quick fix, which has drawbacks (see below):

    1: Do a diff and list only the filenames

    diff -r -q dir1/ dir2/
    

    2: Open and save every listed file with the editor that was used, this will change the line-endings.

    3: Do a regular diff

    Drawbacks include:

    • less robust, error prone
    • more work if you have lots of files
    0 讨论(0)
提交回复
热议问题