If I use bash and type bash , I hit the child shell and you need to type exit to return to the original parent shell. If I forget what I'm on, how can I check?
bash
exit
Use the SHLVL environment SHLVL .
SHLVL
man bash:
SHLVL : incremented each time a bash instance starts.
$ echo "$SHLV" 1 $ bash $ echo "$SHLV" 2 $ exit $ echo "$SHLV" 1
This is a lower answer, but you can also use pstree:
$ pstree -s $BASHPID systemd───systemd───gnome-terminal-───bash───pstree $ bash $ pstree -s $BASHPID systemd───systemd───gnome-terminal-───bash───bash───pstree
Source: https://habr.com/ru/post/1268524/More articles:The string returns at the end and tries to block - javaAdding an external library to a jar of artifacts in IntelliJ IDEA - javaMaven dependencies not allowed in Eclipse - oracleIs it possible to destroy a mutexattr object before using a mutex that was initialized with this mutexattr? - cResize SubView after transition - ios10Kotlin unexpected `unresolved link` - intellij-ideaXamarin facebook fork proguard cannot access. Jar - androidHow to get http headers in React.js - node.jsArray.map () vs d3.selectAll (). Data.enter () - javascriptHow to shake a virtual device created by Genymotion (Android Emulator) - androidAll Articles