For many years I was using tcsh, with lots of useful customizations, that were created during these years. Now I have bash on my laptop and slowly adding what I’ve got used to.

Yesterday I’ve created command line completion rules for mysql-test-run. It’s not a complete set of everything that’s possible, still it’s quite useful as it is. I need to type much less now when invoking mysql-test-run (and I invoke it quite a lot).

If you’d like to try it, paste the below in your ~/.bashrc:

  • http://databaseblog.myname.nl Daniël van Eeden

    Why not put it in /etc/bash_completion.d ?

    Will this be added to MariaDB/MySQL?

  • Sergei

    I’ve never thought of it, frankly speaking. But yes, you’re right. Why not? Thanks for the idea.

    I could add it to the source tree, and then we can include it in mariadb .deb and .rpm packages.

  • Alexey Kopytov

    Thanks for sharing this!

    /etc/bash_completion.d is only read if you have http://bash-completion.alioth.debian.org/ installed, whereas the original recipe depends only on bash.

    OTOH, if you have bash-completion installed (and you normally have), you can also add those lines to ~/.bash_completion which is less intrusive.