On 11/10/05, Marilyn Sander <[EMAIL PROTECTED]> wrote: > > > On Nov 9, 2005, at 4:52 PM, Pablo Wolter wrote: > > > The system function call returns a boolean value as return value, I > > don't > > remember if 1 is for fail and 0 for success or viceversa. > > Actually it is not a boolean value. It is a two-byte value, and each > byte is an integer. You need to look up the system() function in > some Perl documentation. If you get two bytes of zero back, that > means system() and the command it invoked ran successfully. If you > get a non-zero value, the lower byte indicates what error was found > in the Perl run-time; the upper byte is the return code from the > command executed by system(). > > --Marilyn
Bravo Marliyn > > > I think your mistake is the lack of the test construction like if, so > > > > if (system("$addgroup \"$group\"") == 0) { > > ... do something ... > > } > > > > I'm not in a box with perl to test this but something like that could > > work. > > > > Pablo. > > There is no need of puting if condition as command written in the system function execute succesfuly , it will return 0 else non zero value ,what ever the out put it is compared with condition "==0" > > > On 11/9/05, heena s <[EMAIL PROTECTED]> wrote: > >> > >> hi, > >> > >> is there any mistake in the script: > >> > >> #ADDING A TOOL GROUP > >> system("$addgroup \"$group\"") == 0 > >> or die "system @args failed: $?" > >> > >> &log_message("the group $group added"); > >> > >> thanks > >> > >> yes your script is right . onewaylife >> --------------------------------- > >> Yahoo! FareChase - Search multiple travel sites in one click. > >> > > > > > > > > -- > > (o_ Pablo Wolter > > //\ Usuario #284649 > > V_/_ Debian Sid Kernel 2.6.8 > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > >