Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: perl program return error code to ksh

by Anonymous Monk
on Jun 24, 2014 at 18:37 UTC ( #1091087=note: print w/replies, xml ) Need Help??


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.

Replies are listed 'Best First'.
Re^3: perl program return error code to ksh
by blue_cowdawg (Monsignor) on Jun 24, 2014 at 18:42 UTC

    add some code tags pretty please?


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
Re^3: perl program return error code to ksh
by RonW (Parson) on Jun 25, 2014 at 15:47 UTC

    Are you seeing the message:

    Error opening FTP password file, ....

    ?

    Where you say:

    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.

    implies the Perl script error is somewhere else.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1091087]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2021-12-08 01:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (34 votes). Check out past polls.

    Notices?