I wrote a function to handle unknown commands in bash
My intention is to source scripts on demand and access
its functions inside the handler.
But unfortunately the sourced functions run in a subshell so
variables are lost after return/exit.
Finally I did it with some signal/trap/fifo mechanism to command_not_found_handle's parent shell to achieve my goal, but its everything but elegant.
Now I am wondering if
function_not_found_handle loadable builtin could be implemented.
The builtin should be called if
command_not_found_handle () fails.
For the time being I found a great article by Ed Schaefer about this subject, but it seems to be an entrance point.
Is anyone experienced with dynamically loadable builtin bash commands? Who could point me to useful information?
I hope to come up with some results soon to concretize my question.