On Sun, Dec 16, 2001 at 06:54:59PM -0500, David Bellows wrote: ... | #!/bin/sh | while [ "$choice" != q ] | do | read choice | case "$choice" in | a) /usr/local/bin/jac -P1;; #jac is a command line CD player | b) /usr/local/bin/jac -P5;; | c) /usr/local/bin/jac -k;; | #First kill the CD and then start DVD player | d) /usr/local/bin/jac -k; /usr/local/bin/ogle -u cli;; | q) /usr/local/bin/jac -k;; | esac | done | exit 0
Totally untested : #!/usr/bin/env python import sys , os commands = { "a" : "/usr/local/bin/jac -P1" , "b" : "/usr/local/bin/jac -P5" , "c" : "/usr/local/bin/jac -k" , "d" : "/usr/local/bin/jac -k ; /usr/local/bin/ogle -u cli" , "q" : "/usr/local/bin/jac -k" , } while 1 : ch = sys.read( 1 ).lower() if not commands.has_key( ch ) : print "unknown command '%s'" % ch continue cmd = commands[ ch ] os.system( cmd ) # Note: do this last so that the "q" command is executed nonetheless if ch == "q" : break HTH, -D -- If we claim we have not sinned, we make Him out to be a liar and His Word has no place in our lives. I John 1:10