Sample Header Ad - 728x90

How does bash <command-argument> work?

-2 votes
1 answer
66 views
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 () 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 work? As _extra question_: * Under what circumstances the bash 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
Asked by Manuel Jordan (2108 rep)
Aug 26, 2024, 03:04 PM
Last activity: Aug 26, 2024, 04:17 PM