[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ‘command … &’ creates subshell
From: |
Dmitry Alexandrov |
Subject: |
Re: ‘command … &’ creates subshell |
Date: |
Tue, 30 Jun 2020 23:37:34 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Chet Ramey <chet.ramey@case.edu> wrote:
> On 6/29/20 4:33 PM, Dmitry Alexandrov wrote:
>> 1) unexpected, as (a) it does not seem to be documented, (b) itʼs
>> counter-intuitive and (c) other bourne-like shells (busybox ash, dash,
>> ksh93, mksh, zsh) does not do that;
>
> It's an opportunity for optimization, not a bug
I am not saying that this is a bug, only that it is inconsistent with almost
any other bourne-like shell.
>> 2) inconvenient, as in some cases PID of the parent shell is not an
>> appropriate substitute for the PID of the real process.
> since the results are correct.
The results are _different_ across shell and, unfortunately, results provided
by Bash are the least useful. Consider:
$ command … &
[1] 30737
$ strace -p $!
strace: Process 30737 attached
wait4(-1,
:-/
signature.asc
Description: PGP signature