Catch signal when a command fails

I’m trying to build a shell that gives you suggestions if you have a typing error, but I’m having trouble to catch the error.

The user will type something and after parsing it, I will use the execvp() function. The problem I’m having is that if the command is wrong I need to catch that error. I was thinking to use a signal handler, but first I need to know what signal does the bash send when a process uses a command incorrectly.

Go to Source
Author: alvarogv