While experimenting with output redirection and process substitution I stumbled upon the following command and its resulting output:
me@elem:~$ echo foo > >(cat); echo bar bar me@elem:~$ foo
(Yes, that empty newline at the end is intentional.)
So bash echo's bar, prints my usual prompt, echo's foo, echo's a newline, and leaves my cursor there. If I hit enter again, it'll print my prompt on a new line and leave the cursor following it (as expected when someone hits enter on an empty command line).
I was expecting it to write foo to a file descriptor, cat reads it and echo's foo, the second echo echo's bar, and then back to the command prompt. But that's clearly not the case.
Could someone please explain what's going on?