Thursday, April 7, 2011

diff output of two commands

I wanted to be able to do this without creating temp files. Here is what I came up with (after some googling):


$ diff <(command1 arg1 arg2) <(command2 arg)


but I did not like the output of that, because it has all the usual diff notations for line numbers extra. I just needed a clean/exact difference of the two files, so I came up with this:


$ cat <(command1 arg1 arg2) <(command2 arg) | sort | uniq -u

No comments:

Post a Comment