samsonl / enchanter

Automatically exported from code.google.com/p/enchanter
0 stars 0 forks source link

Not able to get output from sendline #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I am able to connect to the server. I am sending a line with the date
command. When I getline i am getting date as the output instead of the
actual date. Please advise.

What is the expected output? What do you see instead?

I wanted to see the system date. But it printed date instead.

What version of the product are you using? On what operating system?

I am using eclipse ganymede on windows

Please provide any additional information below.

My code below:

import java.io.IOException;

import org.twdata.enchanter.SSH;
import org.twdata.enchanter.impl.DefaultSSH;

public class Connect {

    public static void main(String[] args) throws IOException {

        SSH ssh = new DefaultSSH();

        ssh.connect("124.153.88.38", 22, "netmagic", ")nly4Noc");

        // ssh.waitFor(':~>');
        ssh.sendLine("date");
        ssh.waitFor("]$");
        String l = ssh.getLine();
        System.out.println("Server date is: " + l);
        ssh.disconnect();

    }

}

Original issue reported on code.google.com by farooqka...@gmail.com on 9 Mar 2010 at 6:22

GoogleCodeExporter commented 9 years ago
Same problem even Im facing. Please post us how to get the output of 
ssh.getLine()

Original comment by tummidid...@gmail.com on 3 Sep 2012 at 9:14