First page Back Continue Last page Overview Graphics

Back to forks

Now we can also start our test.sh as independent process through fork():

import os, sys

while True:

pid = os.fork()

if pid == 0:

args = ("test","abc")

os.execv('/home/bernd/bin2/test.sh', args)

assert False, 'error starting program'

else:

print 'ProcessID of Child:', pid

if raw_input( ) == 'q': break