Is there a way for me to implement custom fake signals in ksh? Currently am capturing the ERR signal and exiting. However, due to a change, there are calls that may not return success, however that is a valid condition. In such case, I want to make sure that this call generates a different signal or handle the ERR differently. Is there a way to do that?
You can use
killto send any signal you want to the current shell. You can useexitin a subshell orreturnin a function to set any error code you want.Try this script:
Example: