Last Updated: February 25, 2016
·
360
· barteltmatthias

Bash: Process Substitution

"Process substitution feeds the output of a process (or processes) into the stdin of another process." Source

The output of arbitrary commands can be treated like a file by surrounding with <( ).

Example on how to compare a remote file with a local one:

diff my_local_file <(ssh foo@bar.local "cat my_remote_file")

Compare differences of compiler optimizations at assembler level:

meld <(clang -S my_file.c -O2 -o -) <(clang -S my_file.c -O3 -o -)