[vox-tech] Bash completion mystery

Bryan Richter bryan.richter at gmail.com
Thu Feb 23 19:51:27 PST 2012


On Thu, Feb 23, 2012 at 13:00, Bruce Wolk <bawolk at ucdavis.edu> wrote:
> I am trying to find the location of an executable file named
> mkvirtualenv.  If I run "locate mkvirtualenv" it does not find it.  If I
> run "sudo find . -name mkvirtualenv" from the root directory it does not
> find it.  "which mkvirtualenv" yields nothing.  But if I type mkvi<tab>,
> bash completion completes it and it will execute from any directory.
> Can someone explain to me what is going on?  I am using Ubuntu 10.04.
> Thanks.
>

Looks like it's a bash function brought to you courtesy of the package
virtualenvwrapper.

Functions can be discovered with 'declare -f'. There are a ton if
you're using the bash-completion package, so what I'd do is type
'declare -f mkvi<tab>'  ... if it's a function, the full name will tab
complete. Then press <return> to see its definition if you like.

And digging deeper yet, if you incant 'shopt -s extdebug; declare -F
mkvi<tab><return>' you can find where it was defined!


More information about the vox-tech mailing list