2

I'm successfully calling a Perl script from a shell script. Now I want to pass a return value from the Perl script indicating whether it was successful or not to the shell script. How would I go about doing this?

1 Answer 1

10

Simply exit the Perl script with the appropriate exit value.

exit $exit_value;

exit 0;

if ($problem) { exit 1 }

In the shell script you'll have the usual $? to check the return value.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.