#!/usr/pkg/bin/python import sys, os, time os.setpgrp() pid = os.fork() if pid != 0: sys.stderr.write("this should give you a command prompt now\n") sys.exit(0) else: time.sleep(1) sys.stderr.write("echo from the background process\n") time.sleep(1) sys.stderr.write("echo from the background process\n") time.sleep(1) sys.stderr.write("background process dying now\n") sys.exit(0)