Irfan,

*$?*

The status returned by the last pipe close, backtick (`` ) command,
successful call to wait() or waitpid(), or from the system() operator. This
is just the 16-bit status word returned by the wait() system call (or else
is made up to look like it). Thus, the exit value of the subprocess is
really ($?>> 8 ), and $? & 127 gives which signal, if any, the process died
from, and $? & 128 reports whether there was a core dump. (Mnemonic: similar
to *sh* and *ksh*.)


rgds,
Rajeev Kilaru

On 2/2/07, Sayed, Irfan (Irfan) <[EMAIL PROTECTED]> wrote:

 Could you please elaborate what is the meaning of $? >>8;
Regards
Irfan.


 ------------------------------
*From:* kilaru rajeev [mailto:[EMAIL PROTECTED]
*Sent:* Friday, February 02, 2007 8:23 PM
*To:* Sayed, Irfan (Irfan)
*Subject:* Re: command execution

Is it working, Irfan?

Rajeev

On 2/2/07, kilaru rajeev <[EMAIL PROTECTED]> wrote:
>
> Hi Irfan,
>
> You can capture the exit status in the following way.
>
> system("command");
> $ExitStatus = $? >>8;
>
> Regards,
> Rajeev kilaru
>
> On 2/2/07, Sayed, Irfan (Irfan) <[EMAIL PROTECTED]> wrote:
> >
> > Hi All,
> >
> > I am executing following script. but even if the command execution
> > fails
> > it prints as success exit status = 0
> >
> > can anybody please help
> >
> > Regards
> > Irfan.
> >
> >
> > use strict;
> > use warnings;
> > my $CT = '/usr/atria/bin/cleartool';
> > print " Creating the view for VB \n";
> > my $cmd = "$CT mkview -tag vb_test3 -tmode insert_cr -host puvob01
> > -hpath /home/ccvob01/vb_test3.vws -gpath /home/ccvob01/vb
> > _test3.vws /home/ccvob01/vb_test3.vws";
> > print "==> $cmd\n";
> > if (system("$cmd &> /tmp/jui") == 0) {
> >   print " success, exit status = $?\n";
> > } else {
> >   print " failure, exit status = $?\n";
> > }
> >
> >
> >
> >
>

Reply via email to