How can you diff two pipelines without using temporary files in Bash? Say you have two command pipelines:
foo | bar
baz | quux
And you want to find the diff
in their outputs. One solution would obviously be to:
foo | bar > /tmp/a
baz | quux > /tmp/b
diff /tmp/a /tmp/b
Is it possible to do so without the use of temporary files in Bash? You can get rid of one temporary file by piping in one of the pipelines to diff:
foo | bar > /tmp/a
baz | quux | diff /tmp/a -
But you can't pipe both pipelines into diff simultaneously (not in any obvious manner, at least). Is there some clever trick involving /dev/fd
to do this without using temporary files?