On Tue, Nov 03, 2026 at 12:04:10 -0600, grumpy@manlymail.net wrote:
read x < <(do_my_app)
how do i get the return value for do_my_app
Do you mean the exit status? In sufficiently new versions of bash,
you can explicitly wait for it:
hobbit:~$ read -r x < <(echo true; exit 37)
hobbit:~$ wait $!
hobbit:~$ echo $?
37
This requires bash 4.4 or newer. If you need the exit status of that
command in an older version of bash, you'll need to throw away the process
substitution syntax, and use a named pipe and explicit background jobs.