read commands from file and run it
Hi!
How can I read a text file with differents commands like ps aux, ls -al, etc. and run it?
I using fileinputstream and runtime.
I just need some help to find some examples to do that.
This work->
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("c:\\test.exe -id=jallaf -password=jallaf run test");
I want it to be like this:
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(file-with-command.txt + "-id=jallaf -password=jallaf run test");
hope you understanding my problem.
Thanks