In Python using paramiko, I would write code like:<br> cli = SSHClient()<br> cli.connect(....)<br> myIn,myOut.myErr = cli.exec_command(r"""bash -c 'x=`mktemp --tmpdir conf-XXXXXXXX.xml && cat - > $x && echo $x'""")<br> myIn.write(ALotOfStuff)<br> myIn.flush()<br> myIn.channel.shutdown_write()<br> confFile = myOut.read()[:-1],<br>which would net me a temporary file that I'd written stuff to, and its name. Using the ShellStream class doesn't quite work - the standard error is interspersed, there's no return codes, and for some reason shell control codes get interspersed in the data written to the file.<br><br>I figure the most obvious solution is to add an InputStream property to SshCommand. I'm having a go at it @ github.com/mvanderkolff/renci.sshnet-mvdk
Comments: ** Comment from web user: olegkap **
Comments: ** Comment from web user: olegkap **
Hi,
I cant see a reason where you need to use an InputStream as command text, since command text needs to be sent as a whole at once so it needs to be read, so before you execute a command you can read it all as a string and then pass this string to command to execute.