On Tue, May 18, 2021 at 7:53 AM Bart Schaefer wrote > > PPID is not a special variable. Well, I have to take that back; it IS documented as special, but only because it's readonly (which it also is in e.g. bash). Anyway, as per Stephane Chazelas, > POSIX specification of sh says: > > > Set by the shell to the decimal value of its parent process ID > > during initialization of the shell > > [...] it would be more useful if > $PPID reported the realtime value of the parent pid, but no > other shell does it and that would break POSIX compliance, and we > already have sysparam[ppid] as already noted. POSIX doesn't say whether it should be readonly, as far as I can tell. It is not readonly when bash is invoked as "sh" but remains readonly in zsh's sh emulation, which might be considered a bug. So ... hopefully the attached patch addresses the assorted issues raised.