command-not-found
April 6th, 2008 (10:28 pm)
I just installed the latest Ubuntu beta and I'm impressed. There's this command-not-found package that's as simple as fantastic. If you type a non-existent command, it tells you where to find it and how to install the relevant package:
$ emacs The program 'emacs' can be found in the following packages: * emacs21-nox (You will have to enable component called 'universe') * emacs22 * emacs-snapshot (You will have to enable component called 'universe') * e3 (You will have to enable component called 'universe') * emacs-snapshot-nox (You will have to enable component called 'universe') * emacs22-gtk (You will have to enable component called 'universe') * emacs21 (You will have to enable component called 'universe') * emacs22-nox * jove (You will have to enable component called 'universe') Try: sudo apt-get install-su: emacs: command not found
I think it's just brilliant. This thing works with some versions of
bash (using the command_not_found_handle() extension from Debian) and zsh (by fiddling with preexec() and precmd()). I don't know if it'll annoy me after a while but, right now, I love it.






So this has the most direct effect of slowing you down everytime you mistype a command since it will do a lot of lookups and such for every command not in your path.
Also, it can break automated installers or Makefile in interesting ways. Ok you never compile Perl again these days (short of using non interesting alternative operating systems) but this is a very simple case where the Perl makefile searches some commands and expects them to be or not be there.
Have you checked the return code?
[This was my rant of the day]