Re: `read -d x` hangs when run under gnu parallel, even if input is redirected

Russell Harmon <[email protected]> Sat, 13 Dec 2025 17:14:37 -0800
Newsgroups gmane.comp.shells.zsh.user
Message-ID <CA+zrezSBFM1qAWe7L1Lf+NiePjNwMu=K5FbYS-au4P_T7eW_7Q@mail.gmail.com>
That still blocks forever

$ parallel -qu -- zsh -xfc 'read -u 0 -d x </dev/random' ::: a
+zsh:1> read -u 0 -d x

I also found that my workaround of using --tty is inconsistent, but a
better workaround is to ignore SIGTTOU. E.g.

$ parallel -qu -- zsh -xfc 'trap "" TTOU; read -u 0 -d x </dev/random' ::: a
+zsh:1> trap '' TTOU
+zsh:1> read -u 0 -d x
$

On Wed, Dec 3, 2025 at 9:49 AM Bart Schaefer <[email protected]> wrote:
>
> On Tue, Dec 2, 2025 at 6:16 AM Russell Harmon <[email protected]> wrote:
> >
> > $ parallel -qu -- zsh -fc 'read -d x </dev/random' ::: a
> >
> > However the above hangs forever.
>
> Add -u 0 to force reading stdin without considering it to be a terminal?