Originally Posted by yogaboy2
I'd like to know how to change the whereis database, or how it looks for the best command to use. I've updated the locate database but it's not using that as there was no change.
For example, I have a system built version of perl in /usr/bin, but I built a newer one in /usr/local/bin. Running 'whereis perl' in a terminal returns /usr/bin/perl.
I can't find how to do this via a search, would anyone know the answer? Any help would be much appreciated.
This is for an OSX 10.4 box, and the whereis on here doesn't take args.
I may have misunderstood, but I don't think that 'whereis' does what you think it does. The 'whereis' command is a convenience to users to help them locate commands. So, if a command is not executing, a 'whereis' helps you to check that its in your path and have the a[ppropriate rights. That's useful.
When, however, you want to execute 'command_name' the system walks your path itself; it tries '/this/that/command_name' (where this/that/ is the first element in your path) and if that executes, you are in business. If not, it tries /'the/other/command_name' (where the/other/ is the second element in your path)... And, so on.
So, whereis isn't used at this stage. And what gets executed is the first matching element in your path; coming second is coming nowhere. And note that when I say 'you are in business' this is not necessarily the business that you had wanted to be in.
Plese correct me if I'm wrong guys!