Linuxでこのコードを機能させるのを手伝ってくれる人はいますか
public static void main(String[] args) throws Exception,{
String s ="find . -exec ls -al {} \\;";
Process exec = Runtime
.getRuntime()
.exec(s);
exec.waitFor();
System.out.println(s);
if (exec.getErrorStream().available() != 0) {
BufferedInputStream bf = new BufferedInputStream(
exec.getErrorStream());
DataInputStream din = new DataInputStream(bf);
System.out.println(din.readLine());
}
System.out.println(exec.exitValue());
}
次の出力が得られます。
find . -exec ls -al {} \;
find: missing argument to `-exec'
1