If you want the full manuscript, that’s at gitlab: hpr2793_bash_coproc_manuscript.adoc. It’s almost a transcript, but I added spontaneous commentary while reading the examples, so that’s not in the manuscript.
Episode errata:
Command substitution with $() is perfectly valid according to POSIX, and is accepted both by dash and by bash --posix. It’s not to be considered a bashism.
I fumbled the pronunciation of the printf format string in one place and said "parenthesis" instead of "percentage sign".
I tried to say "space" every time there’s a space, but I know I forgot it in a few places. But you probably need to look at the show notes to really make sense of the commands anyway.
Example #1:
$ echo $(echo hacker public radio)
hacker public radio
$ $(echo echo hacker public radio) # It can even supply the command itself, not just parameters. Note the word splitting.
hacker public radio
$ "$(echo echo hacker public radio)" # Counteract word splitting by putting the command substitution in quotes.
bash: echo hacker public radio: command not found
$ `echo echo hacker public radio` # Old-style command substitution
hacker public radio
More on command substitution in Dave’s hpr1903: Some further Bash tips.
Example #2:
$ echo <(echo hacker public radio)
/dev/fd/63
$ cat <(echo hacker public radio)
hacker public radio
You can also combine process substitution with redirection.
Example #3:
$ echo hacker public radio > >(sed -e 's/$/!/') # You need the space between the greater-thans here!
hacker public radio!