|
![](/i/fill.gif) |
Thierry Boudet wrote:
> Thorsten Froehlich wrote:
>>
>> #include <stdlib.h>
>> #include <stdio.h>
>> int main(int ac, char **av)
>> {
>> printf("Result: %d\n", system(av[1]));
>> return 0;
>> }
>>
>> This should work and demonstrate that the system works correctly and only
>
> Don't work. In you invoke a.out with no args, av[1] is NULL.
> nonsense code sometime give intended results...
>
You probably misunderstood Thorsten here.
I think he meant the above program to be used instead of "echo $?",
i.e.:
shell> ./thorstens_program PX
where PX is a program with exit code >256.
Wolfgang
Post a reply to this message
|
![](/i/fill.gif) |