Purposely aborting a Unix shell on an if condition

Multi tool use


Purposely aborting a Unix shell on an if condition
I have created a shell script . I want to abort it on an if condition.
I used exit command for example: exit 1 or exit 42.
It doesn't fail the shell execution.
Please help!!
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.