Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#500703: SHLVL

1 view
Skip to first unread message

martin f krafft

unread,
Oct 6, 2008, 4:20:08 PM10/6/08
to
also sprach Marc Lehmann <sch...@schmorp.de> [2008.10.06.2042 +0200]:
> > What are those semantics of SHLVL, please? You sound like there's
> > some sort of standard.
>
> man bash tells me:
>
> SHLVL Incremented by one each time an instance of bash is started.
>
> this would be broken. zsh has similar wording.
>
> dash doesn'T use SHLVL (contrary to reports) here (as expected, actually).

So it's not a standard.

And that's the problem: since urxvtcd is /bin/sh, the value of SHLVL
passed to the subprocess depends on which shell is used, when in
fact the shell itself is only used to start processes which replace
the shell.

More specifically, if I run execute x-terminal-emulator on Debian
from a shell with SHLVL=1, I get a shell with SHLVL=3 if /bin/sh is
provided by bash or zsh, and SHLVL=2 otherwise.

It's exactly this what I was trying to prevent/counteract with my
patch, which is wrong in that in the situation described in the last
paragraph, the SHLVL values would be 2 and 1 respectively, which is
also wrong.

Indeed, starting login shells and setting SHLVL=1 in .zlogin seems
like the most logical way forward. I do wonder if loginShell has any
other consequences for me though...

--
martin | http://madduck.net/ | http://two.sentenc.es/

god is dead.
-- nietzsche
nietzsche is dead.
-- god
nietzsche is god.
-- dead

spamtraps: madduc...@madduck.net

digital_signature_gpg.asc
0 new messages