Here are a series of posts I put up on the Apple discussion board about tab completion. I think I now know what the problem is, but am reluctant to change anything until I'm sure the changes won't screw up my Fink installation. First I posted this:

I'm currently studying the Peachpit book on OSX Support Essentials and have just arrived at the section concerning tab completion in the Terminal. According to the book, if I start from my home folder, then type P, and then press the Tab key, I should get all the choices available to me within the home folder that start with P. I tried this and it worked for me once. Now, however, after restarting, if I do the same thing, I get only one choice - PPCExplain, which is located in Developer/usr/bin/, and not in my home directory. Thinking a preferences must have gotten screwed up, I deleted the preferences for the Terminal, and restarted - still I get this one result and have no explanation of why this command worked as the book said it would and now it doesn't. I'm quite positive I'm starting from my user folder. Any idea what's going on here? Thanks.

Then I got a number of replies, the most useful of which was:

Your terminal is working correctly. In unix-based systems, tab completion is situation-dependent, and for the most part is relative to the root of the drive. If you open a terminal and type P<tab> it will list all commands that are included in your $PATH variable. The $PATH contains file locations (starting from the drive's root) for all the commonly used utilities. To see what the $PATH contains, type the following command in the terminal:

     echo $PATH


This command will output something like: /usr/bin:/bin:/usr/sbin:/ sbin:/usr/local/bin:/usr/X11/bin

All the paths listed there are targeted when you enter a command. When you press "P<tab>" the system looks for something in these directories that begins with a "P". The terminal assumes "/usr/ bin/", "/bin", and the other paths have already been entered, so typing "P" just completes the path from there.


I then replied:

Thank you for your thorough explanation. The $PATH variable was particularly helpful. The output on my Mac shows this:

/sw/bin:/sw/sbin:/usr/local/mysql/bin:/usr/local/mysql/bin:/usr/bin:/ bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/X11R6/bin

The /sw directory is related to my Fink installation and I think that's the reason the P (tab) command is bringing up items in the Developers folder initially. Someday when I feel the need I'll edit this, but if you'd be so kind, what's the name of the file to edit? It was so long ago that I edited it that I can't remember.

Obviously I edited this file somewhere along the way to try to get mysql working and also Fink. My question now is...can I edit this file and make it so that when I try to use terminal tab completion I don't end up defaulting to the Developers folder and still use Fink successfully? If so, how should I do this?

Thank you for any help.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fink-beginners mailing list
Fink-beginners@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.beginners

Reply via email to