Bash Process Substitution

I saw this and definitely wanted to share it.

diff two variables

Terminal window
VAR1="hello"
VAR2="helllo"
diff -u <(echo "$VAR1") <(echo "$VAR2")
# output:
--- /dev/fd/11 2026-01-17 20:03:59
+++ /dev/fd/12 2026-01-17 20:03:59
@@ -1 +1 @@
-hello
+helllo
Terminal window
paste <(seq 1 5) <(seq 6 10)
# output:
1 6
2 7
3 8
4 9
5 10

read in temp file

Terminal window
less < <(curl -s https://raw.githubusercontent.com/asdf8601/asdfff.dev/main/README.md)

redirect output to a process

Terminal window
echo "hello world" > >(tr a-z A-Z)
# output:
HELLO WORLD