http://qs321.pair.com?node_id=1091087


in reply to Re: perl program return error code to ksh
in thread perl program return error code to ksh

${BIN_DIR}/tapeloadListing.pl >> ${LOGS_DIR}/corps.${VERSION_DATE}.l +og #2>&1 if (( $? == 0 )); then echo "PERL script used to get the tapeload snapshot ra +n successfully" else echo "PERL script used to get the tapeload snapshot fa +iled, hence aborting the script as the files can't be downloaded" | m +ailx -s "CORP V2 BUILD ERROR - ${VERSION_DATE}" ${MAIL_ADMIN} exit 1; fi
The perl code
$fh = new FileHandle; $fh -> open("< /export/home/$ADMIN/pwds/ftp_pass.txt") or die "Error o +pening FTP password file, $!"; $TAPELOAD_PWD = sprintf <$fh>; $fh -> close; print $TAPELOAD_PWD chomp($TAPELOAD_PWD);
If I put in a totally incorrect user in the perl code, the KSH script still continues to run which I want to exit immediately.