My shell script needs to get the result (exit status) and capture the log output from Java application, which writes to its standard output and standard error streas.
To get the status code of the Java application I can do this:
RESULT=$(java <My app>)
To get its output streams I can do this:
$java <My app> >> Mylog.txt 2>&1 || true;
But I can't find a way to get both.