Return value of -1 indicates a failure to start the program or an error of the wait(2) system call (inspect $! for the reason).
You haven't mentioned what $! says but I am at a loss to explain your observed behavior. I typically need to bitshift $? to get the true exit code ($? >> 8) but that obviously does nothing for you here.
Cheers - L~R
In reply to Re: system and $?
by Limbic~Region
in thread system and $?
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |