import java.io.*;
//import java.lang.*;
//import java.util.*;
//import java.math.*;
//import java.util.*;
public class toyshell{
public static void main(
String args[])
{
try{
toyshell toy = new toyshell();
String command ="dir";
String commands[]= new String[3];
//if(command.length()==0)
//{
//System.out.println("bad command");
//}
//else
//{
//System.out.println(command);
//}
if (command.equalsIgnoreCase("dir"))
{
System.out.println("command dir");
commands[0]="command.com";
commands[1]="/c";
commands[2]="dir";
Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec(commands);
BufferedReader reader = new BufferedReader(new InputStreamReader(new DataInputStream( new BufferedInputStream(process.getInputStream()))));
String lineRead =null;
while( (lineRead = reader.readLine() ) != null)
{
System.out.println("hello");
String abc;
abc=lineRead;
//System.out.println(lineRead);
System.out.println(abc);
}
int done = process.waitFor();
System.out.println(done);
process.destroy();
}
}catch(Exception e){System.out.println(e);}
}
}