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

New Post: problems executing command

$
0
0
Hi everyone,

I need to create a connection to a linux machine and execute a .42r binary file.

To run this type of files we have an utility call fglrun. My code is ok, but my problem (think so..) is that i can´t load the enviroment settings, to make the fglrun command runs. I think this is my problem, because if i type a native command such as, 'ls' or 'pwd', I get the correct result.

I have a shell in the linux machine, that is the responsable of running my binary file. Code of the shell:
FGLDIR="/home/genero/241/fgl"
export FGLDIR

/home/genero/241/fgl/bin/fglrun  /home/genero/ssh.42r
echo 123
As you can see, I am trying to load through the fgldir command the fglrun utility. Then i run the .42r file that i want to run and finally 'echo' to see at least, something happends.


To exe my shell i use this .Net Code:
using (var ssh = new SshClient(new PasswordConnectionInfo("MyHost", "User", "Pass")))
            {
                ssh.Connect();
                var cmd = ssh.RunCommand("./ssh.sh");
                Console.WriteLine(cmd.Result);
                ssh.Disconnect();
            };
My shell is called ssh.sh.

Thank you in advance.

Viewing all articles
Browse latest Browse all 1729

Trending Articles



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