Problem while redirecting script output to a file using java
Hi All ,
I was trying to execute a unix shell script and redirect the output to a file in unix machine. When i execute the below command it is working fine
/root/umdhanas/New/hello.sh >> big.txt
But when i try to do the same using java program as below:
Runtime run=Runtime.getRuntime();
Process proc=run.exec("/root/umdhanas/New/hello.sh >> big.txt");
A file by the name big.txt does not get created and redirection does not happen . Please help me how to solve this
Please help on how to get the process id also
Also please let me know how to get the process id of the script executed from java