[NTLUG:Discuss] OT C system call question
Fred James
fredjame at fredjame.cnc.net
Mon Jan 30 16:51:08 CST 2006
All
In C there is "system"
(SYNOPSIS
#include <stdlib.h>
int system (const char *string);
)
What I think I have found is that if the command inside the ( ... ) is a
shell script and it returns a numeric value (as in: exit $i), the C
program will see it as that number multiplied by 256 (i.e., 0 is 0, 1
becomes 256, 2 becomes 512, etc.). [these test were run on an SGI IRIX
6.4 machine]
Can anyone confirm or deny that, or offer any enlightenment, please?
Thank you in advance for any help you may be able to offer.
Regards
Fred James
More information about the Discuss
mailing list