#!/usr/bin/python # -*- Coding: utf-8 -*- import os import sys while True: cmd = raw_input('$ ').strip() if cmd == "exit": sys.exit(0) if cmd == "": continue args = cmd.split() res = os.spawnvp(os.P_WAIT, args[0], args) if res==127: print >>sys.stderr,\ "command not found: %s" % args[0]