Quantcast
Channel: SSH.NET Library
Viewing all articles
Browse latest Browse all 2955

New Post: Issue with command result output

$
0
0
Hi There

I am using SSH.NET package to ssh to the linux box and run command on it in the following way:
using (var sshClient = new SshClient(Connection))
{
   var command = sshClient.CreateCommand(CommandTextString);
   command.Execute();
   var result = command.Result;
}
Command that I run is:
ps -fu sysaccount1 | grep serivce-alerts-retrv | grep -v grep | wc -l
And I got the output of it:

hostname0000001:/$ ps -fu sysaccount1 | grep serivce-alerts-retrv | grep -v g\r
<ysaccount1 | grep serivce-alerts-retrv | grep -v gr \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bep | wc -l \r\n
1

Due to some reason in the returned result it was broken into 2 pars by "\r" and some strange "\b" were introduced. I expect and need it to be as 1 row just as it was sent.

It happens when command length exceeds some value, like 70 characters.

Could you please help to understand and resolve this issue? Is it related to streams buffer length?

Viewing all articles
Browse latest Browse all 2955

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>