If $? isn't -1, it means the shell was required and it was successfully executed. If the shell failed to execute the command, it will communicate this via $?. It chooses what value to return.
If you want more precise diagnostics, don't invoke the shell.
In reply to Re: system and $?
by ikegami
in thread system and $?
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |