What is the command that can I obtain the error code in Unix and Oracle?

If the scripts are execute succesfully, it have a error code, but how can I obtain this value?.