All pastes #561071 Raw Edit

Stuff

public text v1 · immutable
·published 2007-06-12 10:15 UTC
rendered paste body
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Ps {
    
    public static void main(String[] args) {
	try
        {
            String command = "ps aux";
            Process process = Runtime.getRuntime().exec(command);
            BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
            String data = "";
            while((data = reader.readLine()) != null)
            {
                System.out.println(data);
            }
            System.out.println("** END OF LOOP **");
        }
        catch(IOException ioexception)
        {
            ioexception.printStackTrace();
        }
    }

}