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

$SHLVL origin (was: $PPID not updated when the PPID changes (parent killed))



2021-05-18 11:12:54 -0700, Bart Schaefer:
> On Tue, May 18, 2021 at 11:06 AM Stephane Chazelas
> <stephane@xxxxxxxxxxxx> wrote:
> >
> > $SHLVL (a (t)csh thing IIRC, not handled by all shells)
> 
> Bash has it, for sure.
[...]

I remember looking up the origin of it when we were discussing
https://www.zsh.org/mla/workers/2016/msg01574.html

It does come from tcsh in the early 80s (see
https://groups.google.com/forum/message/raw?msg=net.sources/3eER9GEdo2c/B9G1KGziIx4J
for instance).

Also supported by bash, ksh93, fish, zsh and yash (implement in
startup file as shell code only for interactive instances
there), but not much else and not in POSIX.

-- 
Stephane




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