Use perl:
perl -e '$a=shift; `<< other code >>`; exit $a' $? # Fails in csh
Edit This works in csh, too:
perl -e '$a=shift; `<< other code >>`; $a=~s/h// and exit $a; exit shift' "$?h" "$status"
Use perl:
perl -e '$a=shift; `<< other code >>`; exit $a' $? # Fails in csh
Edit This works in csh, too:
perl -e '$a=shift; `<< other code >>`; $a=~s/h// and exit $a; exit shift' "$?h" "$status"