derfleck/minishell

Increase shell level

Closed this issue · 0 comments

Increase SHLVL env variable by one each time a new shell is opened.
The SHLVL environment variable is used to track the number of nested shells or subshells. Each time a new shell is opened, the value of SHLVL is incremented by 1.
The SHLVL env variable is decreased by 1 if user types exit. If SHLVL==1 the bash terminates the parent process.