I am not sure what the return value of subprocess.call()
means.
Can I safely assume a zero value will always mean that the command executed successfully?
Is the return value equivalent to the exit staus of a shell command?
For example, will the following piece of code work for virtually any command on Linux?
cmd = "foo.txt > bar.txt"
ret = subprocess.call(cmd, shell=True)
if ret != 0:
if ret < 0:
print "Killed by signal", -ret
else:
print "Command failed with return code", ret
else:
print "SUCCESS!!"
Please enlighten me :-)