Compare outputs of commands with Diff

Comparing two files with the diff utility is an easy task

diff <file1> <file2>

But if you want to compare the output of two commands without temporarily saving it to a file, it's a bit more complicated, because diff needs two inputs:

diff -u <(echo output1) <(echo output2)
--- /proc/self/fd/11    2013-07-29 10:59:06.037561642 +0200
+++ /proc/self/fd/12    2013-07-29 10:59:06.037561642 +0200
@@ -1 +1 @@
-output1
+output2

As we can see, the shell creates two file-descriptors from the stdin input.

You've successfully subscribed to Tobias Brunner aka tobru
Great! Next, complete checkout to get full access to all premium content.
Error! Could not sign up. invalid link.
Welcome back! You've successfully signed in.
Error! Could not sign in. Please try again.
Success! Your account is fully activated, you now have access to all content.
Error! Stripe checkout failed.
Success! Your billing info is updated.
Error! Billing info update failed.