This reads from stdin:
echo foo | tee >(read line </dev/stdin; echo "internal $line")
You have to keep in mind that a process substitution acts "like" a file.
It could be used where a file is expected. The command tee expects to write to a file.
In that command we are being specific about the device to read from with: /dev/stdin. In that simple example, the /dev/stdin could be removed and that will work also:
echo foo | tee >(read line; echo "internal $line")
If I am understanding your need correctly, this will work:
$ echo foo | tee >(read a </dev/stdin; echo "a is $a") \
>(read b </dev/stdin; echo "b is $b") \
>(read c </dev/stdin; echo "c is $c")
a is foo
c is foo
b is foo
I omitted the PS2 prompt to reduce confusion. Note that each Process Substitution replaces the use of a file (as:
tee FILE FILE ....).
The read does not have to be the first command.
$ echo foo > >(echo "hello" | read b; read a </dev/stdin; echo "a is $a")
a is foo
Note that here the "Process Substitution" needs a redirection,
that is the reason of the two
> >( idiom.
A simple echo, will only print the number of the fd used (the name of the file):
$ echo >(echo "hello")
It is similar to:
$ echo "$file"
Whereas this is a very different idiom:
$ echo > "$file"