Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 16 lines (12 sloc) 335 Bytes
#!/usr/bin/env python
import os, subprocess, sys
cmdlines = []
ps = subprocess.Popen(["ps", "-Ao", "args"], stdout=subprocess.PIPE)
# Skip header line
ps.stdout.readline()
for cmdline in ps.stdout:
# Remove ending newline
cmdlines.append(cmdline[:-1])
cmd = ' '.join(sys.argv[1:])
if cmd not in cmdlines:
os.system(cmd)