Basically I am trying to get something similar to command search with `$PATH`, but with a different list of directories and the file I'm searching for is not executable.

The list of directories is fixed (I can pack it in a variable in the same format as PATH, or whatever), and I don't want to descend in subdirectories. I vaguely recall that bash `complete` has an option for this, but I read through the section and I can't spot it. Am I close?

Maybe something like this (assuming the file is in `~/lib`):

```
> filepath -p ".:/etc:$HOME/lib:$HOME/bin" foo
/home/alexis/lib/foo

```

To put it differently, I'm looking for something like `which` or `which -a`, whatever is easier, but it should not be limited to executables (and it should not search only `$PATH`, but I can work around that ;-)).