Sayed, Irfan (Irfan) 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";
}
In one of my numerous perl books I found the following solution:
my $rc = 0xffff & system(" ... ");
This gives me the return codes I need from what "system" calls.
(Why: I don't know and I forgot where I found it)
--
K. Jantzen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/