I want to compare the output of 2 commands.
$ command1 arguments1 > tempfile1 $ command2 arguments2 > tempfile2 $ diff tempfile1 tempfile2 > savefile $ rm tempfile1 tempfile2
Is there a clever way to do this? Hopefully in one line, and without the need for temporary files.
So, it would be something like (but obviously not exactly this):
$ diff $(command1 arguments1) $(command2 arguments2) > savefile
My machine info is:
$ uname -a Linux host.name 3.2.54 #9 SMP Thu Feb 13 08:17:11 CST 2014 x86_64 GNU/Linux $ which sh /bin/sh