I have a script called teleport in my path. When I type tele and hit tab, I'd like for tab-completion to complete this to teleport.

However, there's another program installed on my system: telepathy-gabble-xmpp-console This starts with the same letters, so tab completion only gets up to telep.

If this were my system, I would just remove that one executable to improve my workflow. However, this is a shared server. (Accounts are not shared.)

Alternately, I could change my $PATH to exclude it. However, telepathy-gabble-xmpp-console is in /bin, and obviously I can't just remove /bin from my path.

The solutions described in this thread don't work, because defining a function or alias will still autocomplete to that function or alias.

How do I take a single executable out of my $PATH?

(Yes, I realize that this is a lot of work for a small benefit.)


1 Answer 1


I solved my problem. I added this line to .bashrc:

export EXECIGNORE=*/telepathy-gabble-xmpp-console

This approach did not work:

export EXECIGNORE=$(which telepathy-gabble-xmpp-console)

Because telepathy-gabble-xmpp-console is installed in both /bin and /usr/bin.

A slight modification works, though, using which -a:

export EXECIGNORE=$(which -a telepathy-gabble-xmpp-console | tr '\n' ':' | head -c -1)

Not the answer you're looking for? Browse other questions tagged .