in reply to EXIT code

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!

Replies are listed 'Best First'.
Re^2: EXIT code
by gaal (Parson) on Jan 11, 2005 at 10:21 UTC
    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?
A reply falls below the community's threshold of quality. You may see it by logging in.