On Apr 02 2022, Zhaofeng Yang wrote: > A simplest example is `timeout 10 timeout 5 cat`. cat cannot read input > from tty stdin.
That's because timeout creates a new process group by default. The outer timeout instance already runs in its own process group curtesy of the parent shell (and thus remains in that group), but for the inner instance the process group no longer matches the terminal process group, and thus the children cannot read from the TTY. You can use timeout --foreground to avoid that. $ timeout 10 timeout --foreground 5 cat -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."