Hi all.

'fink scanpackages' kept giving me 'Command not found.' All I could find on the fink FAQ pages was this:


Q3.18: I've edited my .cshrc and started a new terminal, but I still get "command not found" errors when I run fink or anything that I installed with fink.

A:
(This assumes you are using tcsh ). When tcsh is started, it first reads system-wide scripts, and then those for your user account. It looks first for ~/.tcshrc , and if that isn't found, ~/.cshrc ; note that if you have both, only ~/.tcshrc gets run.

What has probably happened is that some application package (e.g. CodeWarrior) has created a
~/.tcshrc , and therefore ~/.cshrc isn't being read. A good fix is to add the following line to ~/.tcshrc :

source ~/.cshrc

If you are using the example configuration found in /usr/share/tcsh/examples, (which does have some quite cool features), then you will already have a one line ~/.tcshrc file:

source /usr/share/tcsh/examples/rc
Adding the line:
source ~/.cshrc
will not do the trick. Leave it as it is.

As you can see from the /usr/share/tcsh/examples/README below, this configuration also creates a ~/.login file and a
~/.logout file as well. In order for fink to install, (and run in the future), you should disable all three by renaming them
.tcshrc_disabled, .login_disabled & .logout_disabled for instance. I think the conflict lies in the file sourced by .login but you might as well disable all three as they are part of a package, (so to speak). Close and open a new Terminal window and now ~/.cshrc will be correctly read and fink will install and run like a dream.

A quick work around, (until someone more knowledgeable than me finds exactly where the conflict lies, which I hope they will), that quickly does all the renaming is to create two aliases. I've called mine finkon and finkoff. Add the line:

alias finkon 'mv ~/.tcshrc ~/.tcshrc_disabled; mv ~/.login ~/.login_disabled; mv ~/.logout ~/.logout_disabled' (one line, ignore any wrapping)

to your aliases.mine file in ~/Library/init/tcsh, and add the line:

alias finkoff 'mv ~/.tcshrc_disabled ~/.tcshrc; mv ~/.login_disabled ~/.login; mv ~/.logout_disabled ~/.logout' (again, ignore line wrapping)

to your ~/.cshrc file.

I'd love to hear from anyone who's actually spotted/fixed the conflict.

Seb.

Here's the /usr/share/tcsh/examples/README:

This directory contains some useful tcsh files.

In order to use this configuration, type the following three commands:

echo "source /usr/share/tcsh/examples/rc" > ~/.tcshrc
echo "source /usr/share/tcsh/examples/login" > ~/.login
echo "source /usr/share/tcsh/examples/logout" > ~/.logout

To do this system-wide, do the same instead to /etc/csh.cshrc, /etc/csh.login, and /etc/csh.logout.

In order to customize tcsh:

mkdir ~/Library/init/tcsh

and create the following files there as necessary:

aliases.mine - shell aliases
completions.mine - completions
environment.mine - environment
rc.mine - run commands
path - command search path

See the corresponding file in /usr/share/init/tcsh for more information about the role of each file. You can easily extend or override the configuration provided by the default file. For example, you can add more aliases by adding the appropriate commands in aliases.mine.

-Fred
Massachusetts Institute of Technology
[EMAIL PROTECTED]

P.S. You may well find that /usr/share/init/ doesn't exist. So much for more information!

Reply via email to