What is command substitution and process substitution?
IntermediateConceptPackages, Shell & Text Tools
Answer
Command substitution $(cmd) inserts the output of a command as text. Process substitution <(cmd) gives a file path (/dev/fd/63) that streams the command's output, useful for tools that want files.
echo "Kernel: $(uname -r)"
diff <(ssh web1 cat /etc/nginx/nginx.conf) <(ssh web2 cat /etc/nginx/nginx.conf)
Prefer $(...) over backticks: it nests cleanly.
More on Packages, Shell & Text Tools
Compare apt and dnf package management.BeginnerWhat is the difference between `apt upgrade` and `apt full-upgrade`?IntermediateHow do you find which package provides a file or command?BeginnerHow do you pin or hold a package version?IntermediateHow are repositories and their GPG keys configured?AdvancedWhat is the difference between a login shell and an interactive non-login shell?Intermediate