SHLVL – Incremented by one each time an instance of bash is started

commandline session

$ 4.2.36 2 501---> echo $SHLVL
1
$ 4.2.36 3 502---> echo $SHLVL
1
$ 4.2.36 4 503---> bash
$ 4.2.36 1 500---> echo $SHLVL
2
$ 4.2.36 2 501---> logout
bash: logout: not login shell: use `exit'
$ 4.2.36 3 502---> exit
exit
$ 4.2.36 5 504---> echo $SHLVL
1
$ 4.2.36 6 505--->

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s