Question: I'd like for something to hook into the 'command not found' error on bash and offer a useful fix. 

For example:

```
grep-C3  error
bash: grep-C3: command not found

```

It would be nice if it said:

```
Did you mean: grep -C3 error (Y/n)

```

I've seen people include common typos in the .bash\_profile script like 'alias gerp=grep', but I figure someone has probably written a general extension to bash to fix this sort of thing.

Has anyone heard of such an extension?

Answer: 
Looks like [shopt](http://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html) would be a good start.

Also, it appears that [zsh](http://zsh.sourceforge.net/Guide/) has typo correction built in.
the `command-not-found` package should provide this feature in recent distros.

If not, you can invoke it manually from the `command_not_found_handle()` function.

Another alternative is [this](https://github.com/nvbn/thefuck).