Hi Gerrit,

> The only concern I have with this change is the handling of $PPID
>
> $ cat /tmp/t
> echo $PPID
> $ sh -c /tmp/t
> 17254
> $ sh -c 'exec /tmp/t'
> 13318
> $ 
>
> Would this be a regression and, if yes, an acceptable one?

It's a noticeable behavior change and so it should be documented in
the changelog, I agree.

I think the change would be acceptable.  Many other shells (e.g.,
ksh93, bash) follow the same rule so it doesn't hurt script
portability.  POSIX clearly allows it: when XCU 2.12 says

        Utilites other than the special built-ins [...]
        shall be invoked in a separate environment that consists of
        the following.

it is very careful to not include the process ID as part of the
definition.  Natural enough.  Typically non-special builtins like "cd"
are run in the same process, even while they get their own set of
variables, cwd, redirections, and so on.

Regards,
Jonathan



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to