0

Im using SHARPSSH SshShell, i was able to connect to my unix box .. i was able to issue my commands (although having a problem verifying the result)

I was able to issue a TAR command , my problem is determinining if the tar is finished.. is there a way to check this using the SHARPSSH ???

any help would be appreciated..

Dennis
  • 11
  • 1

2 Answers2

1

You didn't show code, so it's hard to judge where the problem might be.

I suggest looking at the official sharpssh samples, specifically this [1] one. It seems to do exactly what you want: Connect, issue commands and waiting for the results/for the termination of these commands.

If that doesn't help, please provide more information.

1: http://sharpssh.svn.sourceforge.net/viewvc/sharpssh/trunk/Examples/sharpssh_samples/SshExeTest.cs?revision=3&view=markup

Benjamin Podszun
  • 9,679
  • 3
  • 34
  • 45
  • sshell.WriteLine("exp system/my4v4t4r# file=PGNIGDV_budjo.DMP log=PGNIGDV_budjo.log full=Y STATISTICS=NONE"); -----HOW CAN I determine if the "EXP" command has finished ?? ---- – Dennis May 16 '11 at 08:47
0
SshExec exec = new SshExec("host","user");
            exec.Password = "pass";
            //if (input.IdentityFile != null) exec.AddIdentityFile(input.IdentityFile);

            Console.Write("Connecting...");
            exec.Connect();
            Console.WriteLine("OK");
            while (true)
            {
                Console.Write("Enter a command to execute ['Enter' to cancel]: ");
                string command = "ls";
                if (command == "") break;
                string output = exec.RunCommand(command);
                Console.WriteLine(output);
            }
            Console.Write("Disconnecting...");
            exec.Close();
            Console.WriteLine("OK");

    enter code here
nut
  • 26
  • 1