From eaf67dc569583adbfd83bd9f0ec3a5eeb2737d84 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 10 Nov 2011 05:19:34 +0100 Subject: Exec plugin now executes the command in sh -c, allowing us to do some shell tricks etc (pipes, for example). --- plugins/exec.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'plugins/exec.py') diff --git a/plugins/exec.py b/plugins/exec.py index f7f451df..c729b555 100644 --- a/plugins/exec.py +++ b/plugins/exec.py @@ -22,12 +22,7 @@ class Plugin(BasePlugin): self.core.command_help('exec') return try: - cut_command = shlex.split(command) - except Exception as e: - self.core.information('Failed to parse command: %s' % (e,), 'Error') - return - try: - process = subprocess.Popen(cut_command, stdout=subprocess.PIPE) + process = subprocess.Popen(['sh', '-c', command], stdout=subprocess.PIPE) except OSError as e: self.core.information('Failed to execute command: %s' % (e,), 'Error') return -- cgit v1.2.3