diffing two ini files
March 22, 2013
Ever need to diff 2 ini files but their sections and options aren’t in the right order?
Well, I do. I googled but I couldn’t find anything trivially available that did this.
I swear I wrote this once before but I couldn’t find it when I looked through my dirs of misc scripts so:
http://fedorapeople.org/cgit/skvidal/public_git/scripts.git/tree/inidiff
hope it is useful to someone.
March 22, 2013 at 6:46 pm
I wonder would sorting be a more functional/unixy operation to provide? Then you could diff <(sortini one.ini) <(sortini two.ini). Also available then are uniq, comm, …
I might just add a –sort option to http://github.com/pixelb/crudini
March 22, 2013 at 6:52 pm
I didn’t know crudini existed, thanks!
But that makes fine sense to me to add –sort into it.
May 15, 2013 at 5:29 pm
I just committed a change to crudini in github to support –format=lines, which will support standard UNIX text processing tools. In this case, diff can be done like:
diff <(crudini –get –format=lines file1.ini|sort) \
<(crudini –get –format=lines file2.ini|sort)
If wordpress mangles the above, please see the description at:
http://github.com/crudini
May 15, 2013 at 6:32 pm
I couldn’t get to that github link
but I did find it here
https://github.com/pixelb/crudini
thanks!