problems editing csh.login

Rhino_G3

Registered
For some reason I am having difficulty setting my paths correctly in csh.login
Here is a copy of what I have now

# System-wide .login file for csh(1).

setenv PATH "/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin"

I just recently installed GPG for OS X and I was trying to create my key pairs by running "gpg" which is installed in /usr/local/bin. When I try the command I get the command not found error.

I had changed my path a long time ago and thought that it was fixed. I have since restarted (not remembering if I had since the csh.login was changed) and am still having the same difficulty. Is there anything that I am missing in adding a path to my environment?
 
Hi Rhino_G3,

Hmm, I could well be mistaken, but the syntax doesn't look quite right to me. An easy way to check is to type:

echo $PATH

to make sure the path is set to what you desired. If not, then try the syntax:


set path = ( path1 path2 path3 )

OR

setenv PATH path1:path2:path3


You may well prefer to edit csh.login, but you could also create a .cshrc file in your home directory instead. I tend to edit the .cshrc file where I can in order to avoid messing with system wide configurations, but this is my personal preference!
 
[Apollo:~] ryan% echo $path
/bin /sbin /usr/bin /usr/local/bin /usr/sbin
[Apollo:~] ryan%


That's strange... usr/local/bin is in there but it wouldn't run any programs there untill I explicitly stated it in the command line. such as executing "/usr/local/bin/gpg" instead of "gpg"

In /private/etc/csh.login I find this...
# System-wide .login file for csh(1).
setenv PATH "/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin"



Again, it's stated but doesn't seem to be using it. I remember adding usr/local/bin to this after saving a copy of the original. I made sure that they syntax was the same as the original file. I may have to go about creating a .cshrc file I guess. Thanks
 
OK, I see the syntax is fine after all. So, if /usr/local/bin is in there but it can't find the command (unless you explicitly type it), then this is the issue and not the path in csh.login.

A friend of mine, who is a Unix administrator, was helping with an installation ages ago and I remember he did "rehash" after modifying one of the "bin" directories. I believe rehash effectively updates the system's list of available commands when changes have been made. Have a look at:

http://www.computerhope.com/unix/urehash.htm

for instance. Perhaps this is worth a try?

Good luck!
 
Strangely enough I did a rehash right after installing GPG, the utility I'm trying to get working.

After reading the man pages again and trying it it seemed to work.

Thanks!
 
Back
Top