Process p = Runtime.getRuntime().exec("sh somescript.sh &> out.txt");
I am running this command using Java. The script is running but it's not redirecting its stream to the file. Moreover, the file out.txt
is not getting created.
This script runs fine if I run it on shell.
Any ideas?
exec
& use aProcessBuilder(String[])
constructor. 3) I heard something about pipes not working in a Java process. – GlaucescentSystem.getProperty("user.dir");
? – WrensRuntime.exec
is largely undocumented. – Finalize