import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class ExecDemoSort {
public static void main(String[] av) throws IOException {
Runtime r = Runtime.getRuntime();
Process p;
p = r.exec("sort sortdemo.txt");
BufferedReader is = new BufferedReader(new InputStreamReader(p
.getInputStream()));
System.out.println("Here is your sorted data:");
String aLine;
while ((aLine = is.readLine()) != null)
System.out.println(aLine);
System.out.println("That is all, folks!");
return;
}
}
阅读(1101) | 评论(0) | 转发(0) |