Hi,

I have the following java code which executes unix commands. i have opened a session. I have a file names test.txt in which i have many lines of GREP commands. I want to execute in a same session like follows.

Session sess= conn.openSession();
FileReader fr = new FileReader("test.txt");
BufferedReader br = new BufferedReader(fr);
String inputscript="";
while((inputscript=br.readLine())!=null){
System.out.println(inputscript);
sess.execCommand(inputscript);
}

When doing this, first line executes successfully but when it goes to second line, it says
"Exception Occured
java.io.IOException: A remote execution has already started."

how to execute multiple commands in a single session?
Please help me.