Find the answer to your Linux question:
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.
  1. #1
    Just Joined!
    Join Date
    Aug 2007
    Posts
    2

    Process within a process


    How can you start a process within another running process in Linux?

  2. #2
    Linux 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
    #

  3. #3
    Just 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

  4. $spacer_open
    $spacer_close
  5. #4
    Linux 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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •