Is there a way to receive "sftp status codes" as part of the sftp command response message on stdout, when an sftp command is issued on stdin.
For instance: Issuing the "get" command interactively to an ftp server, I receive the following response on stdout: 550 filename: No such file or directory. The same command sent to an OpenSSH sftp server receives the following response: Couldn't stat remote file: No such file or directory. File "/local/abbb/foo" not found. I need to programmatically extract the status code off the stdout output. However, I haven't found a way to get the "status code" in stdout. Does anyone know of a way to get the "sftp status codes" sent to stdout, like ftp servers do? I have tried Verbose and Debug options.
