Execute Terminal commands, again ...
in
Programming Questions
•
5 months ago
The following is the shell command I use in the terminal directly:
... in which, "render" is the program, "-n 8" is one of its parameter (number of CPU cores) and the value associated with it, "A.txt" is a base file, "B.txt" is the input file, "C.txt" is the output file.
I've tried the following but none can get the shell script run as it runs in the terminal ...
advices are appreciated!
- /Applications/Software/bin/render -n 8 A.txt < B.txt > C.txt
... in which, "render" is the program, "-n 8" is one of its parameter (number of CPU cores) and the value associated with it, "A.txt" is a base file, "B.txt" is the input file, "C.txt" is the output file.
I've tried the following but none can get the shell script run as it runs in the terminal ...
- import java.io.*;
- String[] cmd = {"/Applications/Software/bin/render", "-n", "8", "A.txt", "<", "B.txt", ">", "C.txt"};
- //method 1
- open(cmd);
- //method 2
- exec(cmd);
- //method 3
- Runtime.getRuntime().exec(cmd);
advices are appreciated!
1