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
$? will contain the return code of some_command just as usual.
$?
some_command
Of course it might also contain a code from bash, in case something went wrong before your command could even be executed (wrong filename, whatnot).