📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Linux Command Line Heredoc and Process Substitution

Heredoc and Process Substitution

4 min read
Heredocs pass multi-line text to commands inline using << EOF. Process substitution <(command) treats command output as a file for tools like diff. These advanced bash features simplify complex input handling in scripts.

Heredoc

cat << EOF > config.yaml
server:
  port: 8080
  host: localhost
EOF

# Process substitution
diff <(sort file1.txt) <(sort file2.txt)