In non-interactive mode (gsh --command) the exit code aggregated from all