I have an equivalent shell command(shown below) which I am trying to run “as-is” from a python script using call command on a linux box and running into compilation error,is there a better way other than call to runt this command?where am I going wrong?
from subprocess import call
def main ():
#ssh -p 29418 company.com gerrit query --commit-message --files --current-patch-set status:open project:platform/vendor/company-proprietary/wlan branch:master |grep refs| awk -F ' ' {'print $2'} |tee refspecs.txt
call (["ssh -p 29418 company.com gerrit query", "--commit-message", "--files", "--current-patch-set", "status:open project:platform/vendor/company-proprietary/wlan branch:master","|grep refs| awk -F ' ' {'print $2'} |tee refspecs.txt")]
if __name__ == '__main__':
main()
I’ve removed
teeto suppress stdout.Note: either part or even the whole command can be implemented in Python.