Hi,
I'm new to Java programming. I need to run unix commands with Java and capture the outputs. From the postings in various forums I got the answer..to use Runtime.exec and StreamGobbler. But the method run() of StreamGobbler does not return anything. In fact I need to call this method from different classes which run different unix commands and produce outputs which are integers or strings..I need to use these values for further processing, rather than just printing out. I also found a method getCapturedOutput which returns a String, but don't know how to use..Waiting for your valuable suggestions..
-J
I'm new to Java programming. I need to run unix commands with Java and capture the outputs. From the postings in various forums I got the answer..to use Runtime.exec and StreamGobbler. But the method run() of StreamGobbler does not return anything. In fact I need to call this method from different classes which run different unix commands and produce outputs which are integers or strings..I need to use these values for further processing, rather than just printing out. I also found a method getCapturedOutput which returns a String, but don't know how to use..Waiting for your valuable suggestions..
-J