Welcome to the Linux Foundation Forum!

How can we know that a particular command invokes a new shell or subshell?

Options

I am going through the learning material and can see mention about new-shell or sub-shell being created by a command. My questions is how do we know when that happens, do we have nay defined list of commands that start a new shell.
I am asking this, since I may be looking at set of commands or a script and want to know at what places the new-shell was created and when that new-shell was exited returning the control to parent shell. Please help.

Answers

  • luisviveropena
    Options

    Hi shekhar84, what chapter and section of LFS207 are you taking a look at, please?

    Regards,
    Luis.

  • coop
    coop Posts: 915
    Options

    to turn your question around, you can see which commands are not starting a new shell:

    type help and you see all the bash built-in commands --anything else should run in a new shell pretty much. You do need to note that typing ls will not start a shell, but /bin/ls will. :)

Categories

Upcoming Training