views:

209

answers:

2

I have two commands, foo and foo-bar, where foo is a symlink to foo-bar. I want to be able to type f+TAB (pretend these are the only two commands on the path that begin with f) and have one of them be completed (meaning the full name and the space after).

What ends up happening though is that it completes to just foo (no space) because of foo-bar. It's obviously not much work to then just hit the space bar, but this interrupts my flow.

Some additional details:

  • foo and foo-bar are in the same directory.
  • Deleting/moving foo isn't an option (I've hidden some details).

Is there a way to ignore a specific path entry?

+1  A: 

Give this a try:

FIGNORE=foo-bar
Dennis Williamson
This almost works, but as noted in the accepted solution, FIGNORE requires a proper suffix.
Edward Mazur
@Ed: Sorry, I misread your question, I was setting it to ignore foo instead of foo-bar. However, `FIGNORE=foo-bar` works for me.
Dennis Williamson
Strange, not sure why `FIGNORE=foo-bar` works for you (doesn't for me). `FIGNORE=oo-bar` does work for me though.
Edward Mazur
@Ed: I tried it on both Cygwyn with Bash 3.2.49(23)-release and Ubuntu with 4.0.33(1)-release. What version is yours?
Dennis Williamson
I tested on bash 3.2.39(1)-release (openSUSE 11.1) and bash 3.2.48(1)-release (OS X 10.6) and bash 4.0.35(1)-release (Fedora Core 12). In all those versions, it only works when I use proper suffix. Have no idea why you are seeing something different.
R Samuel Klatchko
I tested on bash 3.2.25(1)-release (x86_64-redhat-linux-gnu).
Edward Mazur
+2  A: 

You use FIGNORE, although it has some strange properties.

FIGNORE requires a proper suffix. So to ignore foo-bar, any of these will work:

FIGNORE=bar
FIGNORE=-bar
FIGNORE=r
FIGNORE=oo-bar

The import thing is not to try FIGNORE=foo-bar since it's not a proper suffix.

R Samuel Klatchko
Thanks, this worked!
Edward Mazur
`FIGNORE=foo-bar` works for me.
Dennis Williamson