/etc/inittab is set to boot into level 3, but when I run echo $SHLVL it tells me I'm in level 1. Anyone else experience this? -- A lot of us are working harder than we want, at things we don't like to do. Why? ...In order to afford the sort of existence we don't care to live. -- Bradford Angier
On Saturday 04 June 2005 21:01, ken wrote:
/etc/inittab is set to boot into level 3, but when I run echo $SHLVL it tells me I'm in level 1.
Anyone else experience this?
Er, SHLVL has nothing to do with runlevel, it gets incremented by one for each instance of bash you run. For example ~> echo $SHLVL 2 ~> bash ~> echo $SHLVL 3 ~> bash ~> echo $SHLVL 4 For an output of your current runlevel, run the command "runlevel"
Ken, Anders, On Saturday 04 June 2005 12:11, Anders Johansson wrote:
On Saturday 04 June 2005 21:01, ken wrote:
/etc/inittab is set to boot into level 3, but when I run echo $SHLVL it tells me I'm in level 1.
Anyone else experience this?
Er, SHLVL has nothing to do with runlevel, it gets incremented by one for each instance of bash you run. For example
To be clear, it is incremented when one shell invokes a sub-shell. You can have 20 shells running all with SHLVL 1. If you're using a KDE login and start shells in Konsole, e.g., they'll each have SHLVL of 2, since there's a "master" shell somewhere in the ancestry of the interactive shells running in the Konsole windows or tabs that gets everything rolling, after which each Konsole window's or tab's shell will be at SHLVL 2.
~> echo $SHLVL 2 ~> bash ~> echo $SHLVL 3 ~> bash ~> echo $SHLVL 4
For an output of your current runlevel, run the command "runlevel"
And lest the output of the "runlevel" command further confuse, the two run levels output are first the previous runlevel and next the current runlevel. Randall Schulz
participants (3)
-
Anders Johansson
-
ken
-
Randall R Schulz