in reply to Re: multi-command sytem call
in thread multi-command sytem call
Hell it could even be a status of zero. You could explicitly assign an exit(0) to an error exit if you so choose. Take the following code fore example:
In this scenario if the program fails to do what it is suppose to do it will exit with a status of 0. Now this script did not fail to run but if you changed the value of $var it would failed to do what it was suppose to do.#!/usr/bin/perl -w use strict; my $var = 1; if ($var == 1) { print "Hello World!\n"; }else{ exit(0); }
exec() does not return the exit status of the child because , as already explianed, it does not wait for this status report. Instead it returns the status of the forking process itself. If it was able to fork the process into the background it returns a successfull status, if it does not it returns an error status.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: multi-command sytem call
by belg4mit (Prior) on Aug 25, 2004 at 04:53 UTC | |
by Elijah (Hermit) on Aug 25, 2004 at 15:48 UTC |