Convert Korn shell echo status to Perl
Posted on 2008-11-02
I have the following two UNIX Korn shell commands. The semi-colon is needed instead of the pipe symbol after the grep statement otherwise it doesn't work:
chk_auto_up | grep AUTOSYSDB; echo $?
it returns a 0
chk_auto_up | grep AUTOSYSDB2; echo $?
it returns a 1
Both of these shell statements are returning the correct echo status.
When I run this command as Perl:
system("chk_auto_up | grep AUTOSYSDB | echo $?");
system("chk_auto_up | grep AUTOSYSDB2 | echo $?");
they both return a 0
The "chk_auto_up" command is an AutoSys command which checks databases.