Dec 10, 2016 at 4:04 PM
Edited Dec 10, 2016 at 4:04 PM
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);
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
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?