[97361] in RedHat Linux List
Re: SHLVL
daemon@ATHENA.MIT.EDU (Cameron Simpson)
Mon Nov 2 19:32:03 1998
Date: Tue, 3 Nov 1998 11:30:54 +1100 (EST)
X-Original-To: Iztok Polanic <ssdipola@guest.arnes.si>
From: Cameron Simpson <cs@zip.com.au>
Reply-to: cs@zip.com.au
To: Iztok Polanic <ssdipola@guest.arnes.si>
Cc: RedHat List <redhat-list@redhat.com>
Resent-From: redhat-list@redhat.com
On 3 Nov 1998, in message <Pine.LNX.3.96.981102142418.528A-100000@alpha.computers.org>
Iztok Polanic <ssdipola@guest.arnes.si> wrote:
| I was playing around with my enviroment when I saw this at the end of env
| command:
|
| SHLVL=1
|
| What is this? What does t mean??
I'd read the manual entry for whichever shell you're using, probably bash.
Search for SHLVL.
Last time I saw such a thing it counted shell nesting. Fire off a subshell by
saying:
$SHELL
and see what value SHLVL has then. It may increment.
This lets you do things like permit ^D to work in shells where SHLVL > 1
(so you can bail easily but don't accidentally log out) or wire some
tags into your prompt to know if you're in a nested shell or not (which
is occasionally useful).
--
Cameron Simpson, DoD#743 cs@zip.com.au http://www.zip.com.au/~cs/
Once again, I must endorse the alt.peeves suggested universal warning label:
DANGER
THIS PRODUCT IS UNSUITABLE
FOR USE BY IDIOTS.
mathew <mathew@mantis.co.uk>
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com http://archive.redhat.com
To unsubscribe: mail redhat-list-request@redhat.com with
"unsubscribe" as the Subject.