Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: problems executing command

$
0
0
Try:
using (var ssh = new SshClient(new PasswordConnectionInfo("MyHost", "User", "Pass")))
{
                ssh.Connect();
                var cmd = ssh.RunCommand("FGLDIR=\"/home/genero/241/fgl\" /home/genero/241/fgl/bin/fglrun  /home/genero/ssh.42r");
                Console.WriteLine("Result: Stdout: {0} Stderr: {1} ({2})", cmd.Result, cmd.ExitStatus, cmd.Error);
                ssh.Disconnect();
};
Why:
  1. there is no need to have a shell script. Maintaining two sides is overkill IMHO ;)
  2. I suspect the problem was you don't call you shell script with a absoulte path
  3. _Always check your ExitStatus and Error output
If its still not working number 3 can give further hints.

Viewing all articles
Browse latest Browse all 1729

Latest Images

Trending Articles



Latest Images