System.util.execute shell script and exit codes

Is there a way to execute a shell script and get the exit code? ive tried system.util.execute, but it doesnt seem to be recording a response

See this discussion earlier today:

Thank you @pturmel, that was a good read. I got it working with subprocess.check_output, but I may look at the java process builder.

Appreciate the lead.