I seem to have figured it out. Attached is a module with function executeCommand that executes a single command, gathers input, output and error code and returns it.<br>Comment at will.<br><br><br><div><span class="gmail_quote">
On 9/9/07, <b class="gmail_sendername">Konrads Smelkovs</b> <<a href="mailto:konrads.smelkovs@gmail.com">konrads.smelkovs@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>How to obtain the stderror?<br>chanel.SSHChannel has an interesting method extReceived, is it that?<div><span class="e" id="q_114ea2bf8c8f8daa_1"><br><br>On 9/8/07, <b class="gmail_sendername">Paul Swartz</b>
<<a href="mailto:paulswartz@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">paulswartz@gmail.com
</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 9/8/07, Konrads Smelkovs <<a href="mailto:konrads.smelkovs@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
konrads.smelkovs@gmail.com</a>> wrote:<br>> 1) I want to invoke(exec) a command with arguments from a SSH Conch client.<br>> The example suggests that arguments should be passed along with command, so<br>> to invoke 'ls -l', one would pass
common.NS('ls -l'). What to do about<br>> arguments that have spaces? Should I slash-escape them?<br><br>Commands are executed with the -e argument of your shell. You can<br>slash-escape spaces or quote them; either one should work.
<br><br>> 2) How to obtain the retcode from an exec'ed command?<br><br>If the server supports it, it sends a 'exit-status' request to the<br>channel with a uint32 encoded exit code. If it exits with a signal,
<br>an 'exit-signal' message is sent with format:<br> string signal name<br> bool core dumped<br> string error message<br> string language<br><br>HTH,<br>-p<br><br>_______________________________________________
<br>Twisted-Python mailing list<br><a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Twisted-Python@twistedmatrix.com</a><br><a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
</a><br></blockquote></div><br><br clear="all"><br></span></div><div><span class="e" id="q_114ea2bf8c8f8daa_2">-- <br>Konrads Smelkovs<br>Applied IT sorcery.
</span></div></blockquote></div><br><br clear="all"><br>-- <br>Konrads Smelkovs<br>Applied IT sorcery.