Originally posted by macktheknife
I have a question about how to set a path to an application or script through Terminal. I have read as much as I could on the subject, and I know you can set the path to an app with the following command:
echo 'setenv PATH /usr/local/bin:$PATH' >> ~/.tcshrc
However, I want to know *where* this is being written to. Specifically, I am trying to set the path to another directory. I have tried to tinker with the csh.cshrc and csh.login in the /etc/ directory but no luck.
Can someone please let me know what to do exactly? I know I can set another path via the setenv command, but I want to have more control over.
The PATH variable is being written to memory. It is not saved anywhere, AFAIK. When your shell starts up, tcsh for example, it loads a default resources file, kind of like a default preferences. I am not sure where it is, since you and I do not want to necessarily edit that file. You are much better off editing your personal ~/.tcshrc file.
So you know that if you type 'cd' or 'cd ~' that they will take you to your home directly '/Users/yourusername' so ~/.tcshrc is really '/Users/you/.tcshrc
Hey look what i found by typing 'man tcsh'
A login shell begins by executing commands from the system
files /etc/csh.cshrc and /etc/csh.login. It then executes
commands from files in the user's home directory: first
~/.tcshrc (+) or, if ~/.tcshrc is not found, ~/.cshrc,
then ~/.history (or the value of the histfile shell vari-
able), then ~/.login, and finally ~/.cshdirs (or the value
of the dirsfile shell variable) (+). The shell may read
/etc/csh.login before instead of after /etc/csh.cshrc, and
~/.login before instead of after ~/.tcshrc or ~/.cshrc and
~/.history, if so compiled; see the version shell vari-
able. (+)
Non-login shells read only /etc/csh.cshrc and ~/.tcshrc or
~/.cshrc on startup.