Computing.Net > Forums > Novell Netware > Capturing console output? HELP!!

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.

Capturing console output? HELP!!

Reply to Message Icon

Name: Murali Ramaswamy
Date: September 17, 2002 at 13:44:37 Pacific
OS: Netware 5.1
CPU/Ram: SP3 version 8.77
Comment:

Hi,
Usual way of running a command like for example "version" through Java gives IO exception in readline. Please help how this can be done on netware. Code given at end. The command gets excecuted on the console and nothing went to the Process object. It is very unlike on any other platform. I would really appreciate any help.
Thanks (see code below)
-murali

import java.io.*;

public class RunCommand {

public static void main(String args[]) {

String s = null;

try {

// run the "version" command

Process p = Runtime.getRuntime().exec("version");

BufferedReader stdInput = new BufferedReader(new
InputStreamReader(p.getInputStream()));

BufferedReader stdError = new BufferedReader(new
InputStreamReader(p.getErrorStream()));

// read the output from the command

System.out.println("Here is the standard output of the command:\n");
while ((s = stdInput.readLine()) != null) {
System.out.println(s);
}

// read any errors from the attempted command

System.out.println("Here is the standard error of the command (if any):\n");
while ((s = stdError.readLine()) != null) {
System.out.println(s);
}

System.exit(0);
}
catch (IOException e) {
System.out.println("exception happened - here's what I know: ");
e.printStackTrace();
System.exit(-1);
}
}
}



Sponsored Link
Ads by Google

Response Number 1
Name: Scottie
Date: September 19, 2002 at 17:32:04 Pacific
Reply:

I don't know anything about Java, but if you are trying to capture the contents of the console screen, use the following:

LOAD CONLOG

This will capture all screen output until you enter UNLOAD CONLOG. The resulting file will be in SYS:ETC

Don't load CONLOG again until you have moved or copied the old log somewhere else, as it will be overwritten.


0

Response Number 2
Name: Murali Ramaswamy
Date: September 20, 2002 at 09:51:29 Pacific
Reply:

Scottie,
Thanks for the suggestion. I learned a workaround to get the console info. I knew about the console.log but I did not know that this way it could be loaded and unloaded. Still I need to parse the console.log to really get the information. If the console.log is big it will take long time also. It would be better if I could capture the output through the code (or) executing a command with an option like that would write the output to a file that I specify(rather than console.log) so that I can easily parse that file for the output.
Thanks
-murali


0

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 Novell Netware Forum Home


Sponsored links

Ads by Google


Results for: Capturing console output? HELP!!

request help on console command www.computing.net/answers/netware/request-help-on-console-command-/3601.html

Problem with all Novell commands!! www.computing.net/answers/netware/problem-with-all-novell-commands/3609.html

Novell limitation agreed? www.computing.net/answers/netware/novell-limitation-agreed/3740.html