[D-community-offtopic] finding the depth of the current shell
Jochen Schulz
ml at well-adjusted.de
Fri May 6 08:05:09 UTC 2011
Kamaraju S Kusumanchi:
> Inside a konsole running bash shell, If I do
>
> $ # initial konsole prompt
> $ bash # spawn a new shell
> $ bash # spawn third shell
> $ bash # spawn fourth shell
>
> Now is there any command which tells that the current shell's "depth" is 4
> as in it has three "parent shells"?
With bash, you can use $SHLVL. Apparently, dash doesn't support it so I
doubt that it is portable in any way.
J.
--
I wish I could achieve a 'just stepped out of the salon' look more
often. Or at least once.
[Agree] [Disagree]
<http://www.slowlydownward.com/NODATA/data_enter2.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/d-community-offtopic/attachments/20110506/e26c5254/attachment.pgp>
More information about the D-community-offtopic
mailing list