What is process substitution in bash?
Answer
Process substitution treats the output of a command as if it were a file, using the syntax <(command) (for reading) or >(command) (for writing). This is useful when a command requires a filename argument but you want to feed it the output of another command. Example: diff <(sort file1) <(sort file2) compares the sorted versions of two files without creating temp files. while read line; do ...; done < <(find . -name "*.log") iterates over find results in the current shell (important: a plain pipe would run the while loop in a subshell, losing variable changes). Process substitution is a bash/zsh feature not available in POSIX sh.
Previous
What is a heredoc (<<EOF) in bash and when is it used?
Next
What are Linux namespaces and cgroups, and how do they underpin containers?