On Tue, Nov 16, 1999 at 11:31:07AM +0000, Malcolm Wallace wrote:
> which is what you get if you try the same test in C
[then you get "exit 0" -> 0, "exit 1" -> 256, etc]

Only in Unix, not everywhere.  The C standard, IIRC, does not assign
any semantics for the return value except that system(0) returns nonzero
iff there is a command interpreter available and that zero means success
for system(s), where s != 0.

How does system() behave in Win32, for example?  Or in VMS?

> Obviously it would be useful if the expected behaviour were documented
> more tightly, and conformed across compilers.

Just make sure you don't sacrifice portability to weird systems by
demanding more than they can deliver.

-- 
%%% Antti-Juhani Kaijanaho % [EMAIL PROTECTED] % http://www.iki.fi/gaia/ %%%

                                  ""
                             (John Cage)

Reply via email to