About bash
For a new tty when is executed the echo $SHLVL
command it displays 1 as expected. Now, if in the same tty is executed the bash
command and later again the echo $SHLVL
command it displays 2. Is mandatory use the exit
command to exit of course. Furthermore I did do realize that each bash has its own history command and the user is interacting or has access in the current bash.
So far, after to did do a research it seems it is a kind of subshell (correct me if I am wrong), it because mostly a subshell is created through the (<command>)
approach instead.
Just as playing I executed the bash cat /etc/os-release
command and nothing is printed.
Therefore being curious
Question
- How does
bash <command-argument>
work?
As extra question:
- Under what circumstances the
bash <command-argument>
approach would be mandatory to be applied?
Observation
In the answer was indicated to expect an error message. Well, the error mentioned is correct (tested on Ubuntu and Fedora) but in my case the bash cat /etc/os-release
command was applied as an argument to create a docker container based on Linux and none error was shown as indicated from the beginning and it was the reason to create this post. Well it is other history