I am not sure what is return value of subprocess.call() (with shell=True). Can I safely assume a zero value will always mean command executed successfully. Is return vale == exit staus of a shell command ??
Will following piece of code work for virtually any command on linux?
e.g.
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!!"
Pls enlighten me :-)