Retrieving intermediate exit codes to detect failures of each command