Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

$? ($CHILD_ERROR) variable value

Status
Not open for further replies.

1yura1

Programmer
Feb 7, 2003
36
0
0
UA
Hi all in forum.

In my perl script i try to examine $? variable value:
---
system("");
$exit_value = $? >> 8;
if( $exit_value == 0 ){
...
}
When I run the script from command line, $? returns correct value.

But smth. goes wrong when the script is executed by cron (daemon to execute scheduled commands).
Any ideas?

Thanks,
Yura.
 
Yura,
This *might be* because the script is itself a child of the cron daemon - dunno if this is true, just guessing at present.

Can you have the cron job start a shell script, and have the shell script kick off the perl script? Dunno if the same would apply, but it might be worth a punt

Rgds
--Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top