This solution uses a named pipe. Shells compatible with Bourne's should have no problem with it.
fifo=${TMPDIR-/tmp}/$(basename "$0")-$$-foo-bar
mkfifo -m u=rw,go= "$fifo" || exit
foo > $fifo &
bar < $fifo
rm -f "$fifo"
wait $!
This solution uses a named pipe. Shells compatible with Bourne's should have no problem with it.
fifo=${TMPDIR-/tmp}/$(basename "$0")-$$-foo-bar
mkfifo -m u=rw,go= "$fifo" || exit
foo > $fifo &
bar < $fifo
rm -f "$fifo"
wait $!