You Can Invoke the Shell By Hand
You invoke a shell the same way you invoke any other program: type its name.
See for yourself? Type
Want more convincing? Type
If you execute commands, then spawn a subshell, and then try to recall the commands you were just executing before you entered the subshell, you won't find them.
It's important that you have a firm grasp on the idea of subshells before you continue, so I'll return to this, tomorrow.
You get back a prompt, but now this is a second shell, a subshell under the previous shell. The shell you were running a minute ago is now patiently waiting for this subshell to finish, so it can put up another prompt and let you issue some other command.
bash
See for yourself? Type
exit
. You'll exit this subshell, and return to the shell a level up. You're back in the shell you started from.Want more convincing? Type
history
. That's your current shell. Now execute a subshell, and look at the history again:Finally, exit the subshell, and look at the history again:
bash
history
You get two different histories because it's two different shells.
exit
history
If you execute commands, then spawn a subshell, and then try to recall the commands you were just executing before you entered the subshell, you won't find them.
It's important that you have a firm grasp on the idea of subshells before you continue, so I'll return to this, tomorrow.
0 Comments:
Post a Comment
<< Home