I think this will be the responsibility of the library that I use for SSH, in my case it will probably be SharpSSH, and it looks like that does have support for returning the exit code of executed command.
How to obtain exit status code of command running in OSX terminal through SSH?
题
I am writing a custom task for msbuild, it will connect to a Mac using SSH and run a certain command there. I need to obtain the exit status code of that command, and act based on that.
I know that in the OSX terminal I can just run echo $?
to get the status code of the previous command but I'm not sure how I can use that to get a value into a variable inside of my custom build task.
解决方案
不隶属于 StackOverflow