Is it possible to get the exit code from a subshell?

Posted by Geo on Stack Overflow See other posts from Stack Overflow or by Geo
Published on 2010-03-31T20:06:33Z Indexed on 2010/03/31 20:13 UTC
Read the original article Hit count: 359

Filed under:
|
|

Let's imagine I have a bash script, where I call this:

bash -c "some_command"
do something with code of some_command here

Is it possible to obtain the code of some_command? I'm not executing some_command directly in the shell running the script because I don't want to alter it's environment.

© Stack Overflow or respective owner

Related posts about bash

Related posts about script