For example, I have a bunch of test input files for a program and the corresponding expected output in another set of files. And I'd like to do something like
./program < t1.input | diff t1.expected.
Or the simple way using bash:
I often use the more general case
where the two commands might be similar except for e.g. different input files, or different versions of a program operating on the same file. Also works with gvimdiff.
In case you want to diff two outputs of programs, zsh is your friend: