Results 1 to 4 of 4
How can you start a process within another running process in Linux?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-12-2007 #1Just Joined!
- Join Date
- Aug 2007
- Posts
- 2
Process within a process
How can you start a process within another running process in Linux?
- 08-12-2007 #2Linux User
- Join Date
- Jun 2007
- Posts
- 318
Sounds like you're talking about spawning a child process to run something. You do this by adding a '&' to the end of the command. Try this test, run the command to sleep 10 seconds without and with the '&' at the end of the command. Without '&' it'll be 10 seconds before the prompt reappears, with '&' the prompt will immediately reappear because the command runs in the child process. After the child process terminates you'll get a 'Done' message.
Code:# sleep 10 & [1] 14309 # [1]+ Done sleep 10 #
- 08-12-2007 #3Just Joined!
- Join Date
- Aug 2007
- Posts
- 2
So you mean to say that you can a run a child process in the background? is there any other way..like fork(), and create a new process after it....?
I am newbie and sorry if i don't make sense here...thanks for the reply
- 08-12-2007 #4Linux User
- Join Date
- Jun 2007
- Posts
- 318
Yes, a child process can run in the background, even if you log out. I still don't understand what you're trying to do. Could you provide an example. Also, you should read the JOB CONTROL section in the bash manpage (# man bash).


Reply With Quote
