Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Created Unassigned: Bash problemusing ssh.net Library [1591]

$
0
0
Hi, here is my code
```
ssh.Connect();
var cmd = ssh.CreateCommand("ls -all");
var asynch = cmd.BeginExecute(delegate(IAsyncResult ar)
{
Console.WriteLine(cmd.Result);
}, null);

var cmd1 = ssh.RunCommand("bash /etc/motor.sh"); // Perform long running task
var asynch1 = cmd1.BeginExecute(delegate(IAsyncResult ar)
{
Console.WriteLine(cmd1.Result);
}, null);

while (!(asynch.IsCompleted && asynch1.IsCompleted))
{
Console.WriteLine("Waiting for commands to complete...");
Thread.Sleep(2000);
}
cmd1.EndExecute(asynch1);
cmd.EndExecute(asynch);
ssh.Disconnect();

Console.ReadLine();
```
The problem is that command "ls -all" works well but any bash command doesn't work..
Any suggestions ?

Thank you :)

Viewing all articles
Browse latest Browse all 1026

Trending Articles



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