Process Substitution. In Memory File Like
process substitution. It’s useful for passing the output of a command as if it were a file, without needing to create temporary files manually.
Use Case:
Imagine you want to diff
the output of two commands, but don’t want to write their output to files.
Without process substitution:
command1 > file1
command2 > file2
diff file1 file2
With process substitution:
diff <(command1) <(command2)
The <(...)
syntax runs the command inside the parentheses and provides its output as a file descriptor, which diff
can treat like a file. This approach is cleaner and avoids the hassle of managing temporary files.