I cannot do your homework for you see LQ rules but here are the steps :
- use runtime.exec after you get runtime.getRuntime() to execute the process(look at the javadoc of runtime class)
- read the process result from an inputstream(see the javadoc or look on the web how to use inputstream)
- use an inputstreamreader from the inputstream to prepare the next step(see the javadoc )
- use a bufferedreader created from the the inputstreamreader to read each lines(see the java tutorial or google)
- use a tokenizer while reading each lines to split the results(ex: result mem|100m|xxx...) see the javadoc
- do what you have to do with the results(print, write, etc...)
Last edited by mrcheeks; 10-06-2005 at 04:38 AM.