Results 1 to 3 of 3
So I think i got this down but i just wanted to make sure.
OK:
Login shell creates Bash shell.
then when you go to start a proc. your bash ...
- 12-14-2009 #1
is this right?
So I think i got this down but i just wanted to make sure.
OK:
Login shell creates Bash shell.
then when you go to start a proc. your bash shell creates a sub-shell which will run the proc. in order to kill the proc, because of how linux works, you kill the sub-shell. the reason you use a sub-shell is that if you were to run the proc directly from the initial bash shell, when you went to kill the proc it would kill your inital bash shell? any help would be much appreciated!
- 12-15-2009 #2
Not quite. The shell creates a second process (which is not a subshell) by forking off a child which then executes the desired program. Each time you give a command in the shell, another process is forked off. You can of course fork off another copy of the shell (a subshell) but that's unusual. All these processes run concurrently and can be killed independently.
If you give the command "exec program_name", then the program is not forked off; instead the shell process turns into the desired program. And yes, when that dies, your shell is dead and you have effectively logged out."I'm just a little old lady; don't try to dazzle me with jargon!"
- 12-16-2009 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,970
Good explanation Hazel! You rock, lady!
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
