Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: $PPID not updated when the PPID changes (parent killed)



Op 18-05-21 om 20:08 schreef Bart Schaefer:
On Tue, May 18, 2021 at 10:37 AM Martijn Dekker <martijn@xxxxxxxx> wrote:

Op 18-05-21 om 01:15 schreef Bart Schaefer:
Aside, it's a bit odd that SHLVL isn't read-only.

SHLVL is increased even when you do something like 'exec zsh'

Actually no, it isn't.

% echo $SHLVL && exec Src/zsh -fc 'echo $SHLVL'
2
2

I see.

Or, actually, zsh does increase it, but also decreases it when doing an 'exec'. Not all shells do the latter. What I got from ksh93 was:

$ ksh
$ echo $SHLVL
2
$ exec zsh -fc 'echo $SHLVL'
3

Since I now maintain a ksh93 fork, maybe I should fix its 'exec' to act like zsh. It seems like the sensible thing to do.

--
||	modernish -- harness the shell
||	https://github.com/modernish/modernish
||
||	KornShell lives!
||	https://github.com/ksh93/ksh




Messages sorted by: Reverse Date, Date, Thread, Author