Hi all,
i tried to run Linux command from Java Application.
Here i past my code:-
package com;
public class linux_java {
public static void main(String[] args) {
try {
String command = "cut -f 2,5 ABC/test.tab>ABC/test1.tab";
final Process process = Runtime.getRuntime().exec(command);
int returnCode = process.waitFor();
System.out.println("Return code = " + returnCode);
} catch (Exception e) {
e.printStackTrace();
}
}
}
result:
-------
Return code =1
But no new file was created.
But when i run "cut -f 2,5 ABC/test.tab>ABC/test1.tab" command from Linux terminal it's works.
please help me.
Thanks!
Vaskar