#! /usr/bin/python
import os
import sys
import time

print "I am the parent with ID {0}.".format(os.getpid())
pid = os.fork()

if pid==0:
    bootygruby = "/boot/grub"
    print "I am the child with ID {0}.".format(os.getpid())
    print "I want to list {0}".format(bootygruby)
    os.execv("/bin/ls", ["ls", "-l", bootygruby])
    print "Should not get here"
    sys.exit(235)
else:
    print "I am the parent, waiting for {0}!".format(pid)
    winfo = os.wait()
    print "Goodbye {0} with return {1} and status {2}.".format(
        winfo[0], winfo[1]>>8, winfo[1]&255)

