Comprobando si el último command diff tuvo salida

Tengo algunos commands en un file que son como

diff file1 file2 diff file3 file4 

Y si sale algo, quiero imprimir qué command sucedió así, como

 diff file1 file2 if (there was output from the diff command) print "file1 and file2 had the difference" endif diff file3 file4 if (there was output from the diff command) print "file3 and file4 had the difference" endif