exit value of system versus back quotes

S

shrajan

Hi,
I have a script where I am running a command using system and then
using back quotes and I getting different exit status in both cases.
This only happens on linux Redhat 4.0 EL.

`opcmon OSSPI-syslogproc_2=0`;
print "value1 = $?\n";
system("opcmon OSSPIlogproc_2=0");
print "value2 = $?\n";

value1 is -1 and value2 is printed as 0.
Thanks,
Shiju,
 
P

Paul Lalli

I have a script where I am running a command using system and then
using back quotes

No you're not.
and I getting different exit status in both cases.

Which is not surprising when you run two different commands.
This only happens on linux Redhat 4.0 EL.

`opcmon OSSPI-syslogproc_2=0`;
"OSSPI-syslogproc"

print "value1 = $?\n";
system("opcmon OSSPIlogproc_2=0");
"OSSPllogproc"

print "value2 = $?\n";

value1 is -1 and value2 is printed as 0.

Why are you expecting anything different?

Paul Lalli
 

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

Forum statistics

Threads
474,200
Messages
2,571,046
Members
47,646
Latest member
xayaci5906

Latest Threads

Top