Thank you for taking the time to write this very detailed and lucid explanation.
If you want a program to read from stdin and write to stdout, you can use the `cat`, e.g. `echo a | cat` will print “a”.
Lastly, be aware that `echo` is usually a shell builtin that functions like `print`. I’m not sure of all the ways that it might behave differently, but something to be aware of (that it’s not a child process like `cat`).
When you /bin/echo red, then it's a subprocess, and its parent shell continues on, so you always get green somewhere in the output.