On 5/12/24 10:00 AM, Oğuz wrote:
On Sun, May 12, 2024 at 4:33 PM Andreas Schwab <sch...@linux-m68k.org> wrote:
Since the redirection fails and the cat command is never started, bash
doesn't switch the terminal process group

It does on my computer:

554   ioctl(255, TIOCSPGRP, [554])      = 0
553   execve("/usr/bin/wc", ["wc", "-l"], 0x55706d7bac10 /* 30 vars */
<unfinished ...>
554   +++ exited with 1 +++

But it doesn't change the process group ID of `wc' to its PID, so it
ends up in the foreground process group with bash.

Command substitutions and process substitutions run in the same process
group as the shell performing the word expansions. This is how ksh93 does
it as well (zsh, by contrast, performs the setpgid in the process forked
to run the process substitution).

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to