Use Redirection Instead of Temp Files

There are certain commands that really want to read input in from a file, like diff. However, if what you're trying to manipulate or use with one of these commands is actually output from another command usually you'd have to write this information out to a file before reading it back in with the command that just doesn't care about getting the previous output piped to it.

However, instead of resorting to creating all those temporary files we can use process substitution to redirect the output from a command to a file descriptor. Then any command that would normally read from a file can instead take its input from these file descriptors:

diff -y <(printf "a\nb\n") <(printf "a\na\n")
a               a
b             | a

Goodbye temp files!