|
|
How to add paths to tcsh
|
|
|
|
Grizzled Veteran
Join Date: Jul 2001
Location: Sydney, Australia
Status:
Offline
|
|
How do you add paths to tcsh in a normal 10.2 install? I just can't work it out. Say I want to add /sw/bin into my path (fink didn't do it automatically for some reason), where would I enter that? I can do it for bash, but I dislike bash and would rather use tcsh. Any help?
|
You can't eat all those hamburgers, you hear me you ridiculous man?
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: May 2001
Location: Sierra Nevada Country
Status:
Offline
|
|
for fink, just add this line
Code:
source /sw/bin/init.csh
to your ~/.cshrc file.
That should do the trick.
If in the future you wish to add more paths to your path environment variable, just add this line:
Code:
setenv PATH "{$PATH}:/new/path/to/add"
to the same file I mentioned previously, then either open a new terminal window or type 'source ~/.cshrc' to activate the path change. You can also add the new path 'before' the {$PATH} part and the shell will search the new path first, before searching the rest of the paths (just reverse the order I showed).
Hope that helps ya.
|
First there was man, then there was Macintosh
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Jul 2001
Location: Sydney, Australia
Status:
Offline
|
|
That line for fink is present, however it still doesn't work for some reason (strange, I know). You might find this interesting.
Last login: Mon Nov 11 21:08:24 on ttyp1
Welcome to Darwin!
[agnetham:~] benw% cat .cshrc
setenv PATH "${PATH}:/testdir"
[agnetham:~] benw% echo $PATH
/Users/benw/bin/powerpc-apple-darwin:/Users/benw/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
[agnetham:~] benw%
And yes, there is a dir called "testdir" in /
Any ideas?
Originally posted by graffix:
for fink, just add this line
Code:
source /sw/bin/init.csh
to your ~/.cshrc file.
That should do the trick.
If in the future you wish to add more paths to your path environment variable, just add this line:
Code:
setenv PATH "{$PATH}:/new/path/to/add"
to the same file I mentioned previously, then either open a new terminal window or type 'source ~/.cshrc' to activate the path change. You can also add the new path 'before' the {$PATH} part and the shell will search the new path first, before searching the rest of the paths (just reverse the order I showed).
Hope that helps ya.
|
You can't eat all those hamburgers, you hear me you ridiculous man?
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: May 2001
Location: Sierra Nevada Country
Status:
Offline
|
|
Hrm...
maybe try the same path argument without the '{}'. I move so much between the bash and tcsh shells that I forget which commands go to which.
As to the problem with your .cshrc not executing the init.csh script, there could be a few different causes:
1. Improper permissions on the script
2. Having a .tcshrc file in your home directory
3. not having a carriage return in your .cshrc file after the 'source...' line.
I'd check these things first.
The permissions problem can be solved by typing:
Code:
sudo chmod 755 /sw/bin/init.csh
This makes it executable by any user.
The next most common problem is adding the 'source' line to your .cshrc without hitting 'return' at the end of typing it.
In order for it to execute, there has to be an end-of-line marker such as a carriage return. Make sure your .cshrc file is correct and has an (invisible) return after the command.
You may also have a .tchsrc file in your home directory, which I think the tcsh shell prioritizes over a .cshrc file. In other words, your shell may not be reading the right config file. If you have any data in the .tcshrc file, you can append it to the .cshrc file with this command:
Code:
cat ~/.tcshrc >> ~/.cshrc
then remove the .tcshrc file.
Other than that, I don't know what else could be going wrong...
What happens when you just type 'source /sw/bin/init.csh' at a command prompt?
|
First there was man, then there was Macintosh
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jul 2001
Location: NC
Status:
Offline
|
|
Naturally I think that setenv for $PATH should work. However, everything I read sets $path with a different syntax from every other environment variable. Further, nothing I read explains the syntax but they are consistent. The syntax uses set instead of setenv, an equals, "=", an enclosing parenthesis and a space delimited list. I do recall this from csh. An example looks like:
set path = ( $path /<new>/<dir> )
Again, I have no explaination for the syntax but I'd eagerly read any reference that anyone knows of that explains it.
|
Gary
A computer scientist is someone who, when told to "Go to Hell", sees the
"go to", rather than the destination, as harmful.
|
|
|
|
|
|
|
|
Senior User
Join Date: Nov 2001
Location: State of Denial
Status:
Offline
|
|
Try putting the $ OUTSIDE of the {}'s; i.e., ${PATH} instead of {$PATH} .
|
[Wevah setPostCount:[Wevah postCount] + 1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|