strange tcsh behavior

gslobber

Registered
Hi. I'm running OS X 10.1 on a 2001 ibook (500 MHz). I've recently installed Fink and XDarwin (XFree86 4.2), and everything seems to be working fine except for some strange behavior in my tcsh shell. Specifically, autocompletion and spell checking are unable to see my new binary directories /sw/bin and /sw/sbin.

I've verified that these directories are correctly set in my path (using echo $path and echo $PATH), and if I type 'which eterm', I get the correct answer (/sw/bin/eterm). This creates a strange situation where every time I type 'eterm' at the command prompt, and I get the spelling checker saying 'OK term?', after which I type 'no' and then eterm launches.

I've looked at all of the setup files in /usr/share/init/tcsh, and everything seems to be okay there. I also tried creating local setup files (in ~/Library/init/tcsh) to explicitly add /sw/bin to my path, but that doesn't help either (I just get a double entry for that directory in $path).

Actually, I'm not exactly sure which file was modified during the Fink installation to add /sw/bin and /sw/sbin to my path in the first place. They don't appear in any of the system-wide tcsh files (in /usr/share/init/tcsh), and they are not in any of my local setup files.

Any help would be appreciated,
Doug.
 
putting /sw/bin before anything else in your set path statement in your .cshrc or .tcshrc file should fix that problem.

Justin
 
Thanks, Justin. I can't try that right away (my mac is at home), but I wonder why the order of directories in my path should make any difference? Not that you have to answer such questions... if it works, it works!

Doug.
 
I only think that because if you put a directory before another, that means it has a higher priority, so if you had two different versions of pine commands one in /usr/bin and one in /bin, then the one that was set in the path first (/bin is default) would have higher priority and be used instead of the one in /usr/bin just because it is declared first. Sorry if that doesn't make sense, I can help you more if you need it...

Justin
 
Unfortunately, putting these directories at the beginning of the path didn't solve the problem. In fact, they were already at the beginning of the path (although again, I don't exactly know which file is being used to specify my path). Remember, my problem is only with tcsh completions and spelling correction. I would have thought that any command in my path would be visible to these features, but they are not. Any other suggestions?

Thanks,
Doug.
 
Well, would you post your .cshrc or .tcshrc file (whichever one you use) and then maybe from that we can see what is wrong.

Justin
 
Hi Justin. My .cshrc only contains the line 'source /sw/bin/init.csh'. I have no customized tcsh rc files. I've tried setting my path explicitly in a number of places (like in the .cshrc and in ~/Librarby/init/path), and that hasn't helped. I suppose this isn't a path problem per se, but rather some quirk with the way autocompletions and spell checking in tcsh is set up, which seems strange because I haven't touched any of the system-wide setup files in /usr/share/init/tcsh).

By the way, it just occurred to me to actually LOOK at the shell script /sw/bin/init.csh. I found that that's where /sw/bin and /sw/sbin are being added to the path (to answer my own question earlier about where the path is being set up).

It uses the line: set path = ( /sw/bin /sw/sbin $path /usr/X11R6/bin )

Doug.
 
Back
Top