Hi Rob,
I've connected unix box with this code : Using enchanter jar
import java.util.*;
public class MainSSH {
/**
* @param args
* @throws IOException
*/
public static void main(
String[] args) throws IOException {
SSH ssh = new DefaultSSH();
String line =null;
List ss = new ArrayList();
ssh.connect("", 22, "ddd", "");
ssh.waitFor("]$");
ssh.sendLine("cd ");
ssh.sendLine("ls omg.bmp");
ssh.sendLine("tail omg.bmp");
System.out.println(ssh.getLine());
ssh.disconnect();
}
}
With this code I can connect to the unix box but what I need to do is, I've to print the contents present in the "omg.bmp" after the tail command.. So Is there any way to print all the lines of the tail command in java. Please help me with this immediately. As I'm new to java, I'm not able to proceed with this.. Your help is really appreciated.