Computing.Net > Forums > Unix > multiple unix commands in 1 session

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

multiple unix commands in 1 session

Reply to Message Icon

Name: gravi2020
Date: January 15, 2009 at 08:50:47 Pacific
OS: Windows XP
CPU/Ram:
Product: /
Subcategory: Software Problems
Comment:

Hi,

Iam trying to code in java and wanted to run the commands in the Unix remote servers. I have the following code to run multiple GREP commands from a file in a single session.

But when i execute this, the first command executes successfully, whereas from the next line it says

"Exception Occured
java.io.IOException: A remote execution has already started."

Following is my code snippet :

FileReader fr = new FileReader("grepcommands.txt");
BufferedReader br = new BufferedReader(fr);
String inputscript="";
sess= conn.openSession();
while((inputscript=br.readLine())!=null){
sess.execCommand(inputscript);
}
sess.close();

It would be great if anyone can provide me the solution for this.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: multiple unix commands in 1 session

running unix command in vi session www.computing.net/answers/unix/running-unix-command-in-vi-session/7869.html

Run Unix command in DOS FTP prompt. www.computing.net/answers/unix/run-unix-command-in-dos-ftp-prompt/8494.html

unix command in c www.computing.net/answers/unix/unix-command-in-c/7438.html