I have a python script that launches a bunch of commands via ssh
ins = []
outs = []
errs = []
for sourceId in range(N):
fname = WE.current_path + "/DATA/fsismos_P" + format(sourceId, '04d')
cmd = "sustrip < " + fname + "_addnoise.su head=" + fname + ".headers > " + fname + "_addnoise"
stdin, stdout, stderr = ssh_client.exec_command(cmd)
print(cmd)
outs.append(stdout)
errs.append(stderr)
for out in outs:
out.channel.recv_exit_status()
for err in errs:
err.channel.recv_exit_status()
print(err.read().decode('ascii').strip('\n'))
The command fails and returns a
sustrip: subcalls.c: efopen: fopen failed
However, when I manually connect onto the server and type the command it works perfectly fine. How is that possible ?