I am using the ssh.net library and I am trying to run the following command:
string theCommand=grep <stringToLookFor> <filePathAndName>
client.RunCommand(theCommand);
The process hangs.
Then I tried using asynch:
SshCommand cmd=client.CreateCommand("grep "+stringInFile+" " + directory+fileName);
var asynch=cmd.BeginExecute();
while (!asynch.IsCompleted)
Any ideas on how I can run this grep command?
Thanks.
string theCommand=grep <stringToLookFor> <filePathAndName>
client.RunCommand(theCommand);
The process hangs.
Then I tried using asynch:
SshCommand cmd=client.CreateCommand("grep "+stringInFile+" " + directory+fileName);
var asynch=cmd.BeginExecute();
while (!asynch.IsCompleted)
{
System.Threading.Thread.Sleep(100);
}
cmd.EndExecute(asynch);
And it does not return neither.Any ideas on how I can run this grep command?
Thanks.