execute shell to parse/execute command line

This commit is contained in:
Josh Holtrop committed 2011-02-04 10:53:25 -05:00
1 parent 231b980a2c
commit 0433a7c2db
1 file changed
+9 -2
+9 -2
View File
@@ -1,6 +1,8 @@
#!/usr/bin/env python
import os
import sys
import re
import gtk
import gobject
@@ -48,8 +50,13 @@ class Window:
def main(argv):
w = Window()
cmd = w.run()
print 'cmd:', cmd
cmd = w.run().strip()
shell = '/bin/sh'
if 'SHELL' in os.environ:
shell = os.environ['SHELL']
shname = re.sub('.*/', '', shell)
if cmd != '':
os.execl(shell, shname, '-c', cmd)
if __name__ == "__main__":
main(sys.argv)