Menu

New Feature Suggestion, compare configuration files

malc
2014-09-21
2014-09-23
  • malc

    malc - 2014-09-21

    Hi,

    Can I suggest a new feature for Kdiff, unless there is already a program out there that does this? I find Kdiff does not work too well when comparing config files like you find in /etc. Often the line order in these doesn't matter so

    Line A
    Line B

    is functionally the same file as

    Line B
    Line A

    Or, I wonder if it is possible to use a preprocessor to sort the lines in the 2 files before comparison as that should remove a lot of identical files. The documentation is a bit thin on examples for the preprocessor and has more for the line-preprocessor. This suggestion would make a good and useful example if it is possible to do it.

     
  • malc

    malc - 2014-09-21

    OK, it wasn't too hard after all. I came up with this preprocessor line

    perl -e 'print sort <>'

    Which sorts the file lines before the compare.

     
  • Joachim Eibl

    Joachim Eibl - 2014-09-23

    Well done!