blob: 57849a4c7c0776eee7f93eba55fbc4a745f0ff78 [file] [log] [blame]
import subprocess
import sys
def shellcmd(command, echo=True):
if echo: print '[cmd]', command
if not isinstance(command, str):
command = ' '.join(command)
stdout_result = subprocess.check_output(command, shell=True)
if echo: sys.stdout.write(stdout_result)
return stdout_result