Ksh-ish functionality on Unix systems
Greg Weeks
weeks at vitus.scs.agilent.com
Sun Sep 23 21:07:01 EDT 2001
More information about the Python-list mailing list
Sun Sep 23 21:07:01 EDT 2001
- Previous message (by thread): Ksh-ish functionality on Unix systems
- Next message (by thread): time.timezone gives strange results on cygwin
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Quinn Dunkan (quinn at retch.ugcs.caltech.edu) wrote: : Or you could turn around and try a set of pure python plumbing classes that : wrap up all the nasty pipe() and fork()iness; it sounds like a fun project. That is tempting. But for some tasks it really is simpler to create a new language. The "re" module is an example. It think it would be significantly more awkward if a regular-expression was an abstract data type with a bunch of methods for creating the desired state. Better in this case to create a little language and scan/parse it. And such, I have tentatively guessed, is also true for process invocation and redirection. And, since os.system does invoke "sh", that pretty much handles the problem that I raised in the basenote. All the functionality that I said I wanted is in os.system or commands.getoutput. So, basically, Python already had the problem handled in a reasonable way. Good! Regards, Greg PS: There is more to the story at my end, though. I would like a version of os.system that throws an exception if the command fails. In addition, I would like the command to fail if any subcommand fails. (In shell language this is "set -e".) So I wrote a little function with the above properties. Unfortunately, I found that "sh" on HP-UX has a bug: "set -e" doesn't work with the -c option. So, with regret, I invoked ksh instead.
- Previous message (by thread): Ksh-ish functionality on Unix systems
- Next message (by thread): time.timezone gives strange results on cygwin
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list