execute shell to parse/execute command line
This commit is contained in:
parent
231b980a2c
commit
0433a7c2db
11
py-launcher
11
py-launcher
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user