I don't know PERL, but this is how you do it in Perl (with perl) and catch it in the a shell. (And as a bonus, even echo the caught value.)
perl -e 'exit 5' ; perl_exit_code=$? ; echo $perl_exit_code
HTH,
Update: Yup, gaal is right. In this context, "the shell" does not exist. I have modified my answer accordingly.
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
| [reply] [d/l] [select] |
You mean, that is how to do it in Bourne and Bourne-ish shells. In c shells the value is in $status; in others, who knows?
| [reply] [d/l] |
No such a thing as "PERL". Please check
perldoc -q '"perl" and "Perl"'
To answer your question:
perldoc -f exit
| [reply] |
Sidhekin already mentioned the spelling. Nice refering the faq though.
But perldoc -f exit doesn't help the OP much.
You're right - I was mistaken, I'm sorry.
Cheers, Sören
| [reply] |