Return-Code of "system" on a 64-bit system

S

Sergeant_Pepper

Hi,

I use these statements under Perl 5.6.x on SuSE Linux 7.2 (32-bit
system) and under Perl 5.8.x on Suse Linux Enterprise Server 9
(64-bit-system):

my $rc=system("ps -p 4711");
if ($rc==0)
{
# do this
}
else
{
# do that
}

If process "4711" is running, $rc contains "0" under Suse 7.2 (32-bit),
but it contains "-1" under Suse 9 (64-bit).

Why?

Thank you...

Many greetings from Hannover, Germany
 
D

Daniel Pfeiffer

Moin Ulli,

la 18.12.2005 01:35 Sergeant_Pepper skribis:
I use these statements under Perl 5.6.x on SuSE Linux 7.2 (32-bit
system) and under Perl 5.8.x on Suse Linux Enterprise Server 9
(64-bit-system):

my $rc=system("ps -p 4711");
if ($rc==0)
{
# do this
}
else
{
# do that
}

If process "4711" is running, $rc contains "0" under Suse 7.2 (32-bit),
but it contains "-1" under Suse 9 (64-bit).

Nö, -1 bedeutet, daß der Befehl nicht gestartet werden konnte (z.B. kaputter
$PATH, oder keine Ausführungsrechte).


coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer
 
S

Sergeant_Pepper

Hi, Daniel,

thanks for answering.

I knew the meaning of "-1" (error starting process), but that's not the
solution. I checked this aspect...

Greetings
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top