-
Executing Multiple Unix Commands in one SSH Session from Java Program
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.
Similar Threads
-
Replies: 1
Last Post: 08-15-2006, 03:20 PM
-
By Dharmesh in forum .NET
Replies: 4
Last Post: 10-01-2001, 03:47 PM
-
By JJ in forum Enterprise
Replies: 1
Last Post: 07-06-2000, 04:50 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks