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
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import re
|
||||||
import gtk
|
import gtk
|
||||||
import gobject
|
import gobject
|
||||||
|
|
||||||
@ -48,8 +50,13 @@ class Window:
|
|||||||
|
|
||||||
def main(argv):
|
def main(argv):
|
||||||
w = Window()
|
w = Window()
|
||||||
cmd = w.run()
|
cmd = w.run().strip()
|
||||||
print 'cmd:', cmd
|
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__":
|
if __name__ == "__main__":
|
||||||
main(sys.argv)
|
main(sys.argv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user