Help! Trying to update the PATH variable info

yoyo1234

Registered
Just installed Mac OS X version 10.2 and I'm having problems with MySQL which is requiring me to update the PATH data in the .tcsh file in my home directory. Unfortunately, I do not have this file in my home directory. I've looked EVERYWHERE and cannot find it. Where is it located? Am I supposed to install the Developer tools to be able to edit this file?
 
No, all you need is vi. :) Are you looking in your home directory with Finder or in the Terminal? A 'dot file' won't be seen in Finder unless you enable that. If you ARE looking in Terminal, maybe it's call .cshrc. tcsh will use either.

HTH....
 
I have been using the terminal.

I type "cd ~"
Then "ls -la"
All it see that starts with a "." is .CFUserTextEncoding, .DS_Store, .Trash, and .mysql_history

That is all.

Any other ideas?
 
Then I guess there's no default one in each user's home dir. Create a ~/.tcshrc and put in the following line:

set path=($path /new/mysql/path)

That will add the new path to whatever your existing path is from the system default. After you are done with the file, type:

source ~/.tcshrc

and it will enable that new path.

Let me know if this doesn't work for you.
 
Well, Now I have something else going on now.

Maybe I should give you the whole story.

I used Entropy's My SQL installer.
in step 8 on this page:http://www.entropy.ch/software/macosx/mysql/#update

It states this:
If you do not want to have to type "/usr/local/bin" in front of every command, you have to add the /usr/local/bin directory to your PATH environment variable in your login script. For the default tcsh shell, you can do this by running this command once:
"echo 'setenv PATH /usr/local/bin:$PATH' >> ~/.tcshrc"

So what I did, as per your request, was create a .tcshrc file, copy and paste "echo 'setenv PATH /usr/local/bin:$PATH' >> ~/.tcshrc" in the text located at Entrophy's website and save the file in my home directory.

Now when I typed source ~/.tcshrc I got this error:
/var/root/.tcshrc: No such file or directory

Any other ideas? :confused:
 
Ah, I see. No, what that command does is put

setenv PATH /usr/local/bin:$PATH

into ~/.tcshrc. It was supposed to be a one-time command from the command line. Replace that line you put in the file with what's above.

But, before you do that, type 'set' at the command line and make sure that /usr/local/bin isn't already in your path. Also try 'setenv'. It's in mine, but I may have added it to the system default path.
 
I had the same problem - I did what you suggested with the Path and that fixed the 'Command Not Found' error.

But now it does this when trying to run Mysql

dyld: ./bin/mysql Undefined symbols:
./bin/mysql undefined reference to _BC expected to be defined in /usr/lib/libSystem.B.dylib
./bin/mysql undefined reference to _PC expected to be defined in /usr/lib/libSystem.B.dylib
./bin/mysql undefined reference to _UP expected to be defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap

I've reinstalled it already, and installed fresh. Any ideas?

EMH.
 
I have no clue about MySQL, but in terminal, just type pico .cshrc and then enter desired lines in threre, then press ctrl-x to exit, remember to save changes...
 
You guys need to read the Darwin / UNIX forum more ;)

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

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

I've added|
:/user/local/bin/:/usr/local/sbin/
set autolist #autolist makes tab completion work right


Save the changes and open a new terminal window. Everything should be fixed.

hth

[edit]forgot to mention that editing /etc/csh.login will fix the problem system wide, not just for your ~ user. the csh.* files are used every time someone logs in[/edit]
 
There is a Prefence Pane called RCEnvironment that can change the PATH variable. Here is the readme file - you can figure out where to download it from that. It worked in 10.1.5 but I haven't had a chance to try it out in Jaguar since I only got my copy yesterday.


RCEnvironment

RCEnvironment is a Mac OS X 10.1 or higher preference pane that allows a user to edit their ~/.MacOSX/environment.plist file. This file is simply a property list of keys and values that the login system will read and load into the process environment of all applications that are launched when the user logs in. These variables are the same as environment variables that can be created in a command line shell (eg: sh or csh), but they also can be seen by GUI applications. In this, these environment variables are somewhat similar to Windows' Environment User Variables.

While the PropertyListEditor that Apple provides with the developer tools can be used to edit this file, that tool allows more flexibility than should be specified in the environment file, plus you have to install the developer tools to get that tool, while this is a simple editor that ensures the file is setup correctly and does not require the developer tools.


Installation and Usage

To install RCEnvironment.prefPane just copy it to ~/Library/PreferencePanes or /Library/PreferencePanes and launch System Preferences. You may have to create the directory first.

Using RCEnvironment is very simple. Use the '+' and '-' buttons to add or remove variables from the list. Once you have set up the list of variables the way you want, just press the 'Apply' button. Duplicate and blank names are not allowed. At any time, you can 'Revert' back to the current state of variables.

Once you have saved changes to your environment, you must logout and log back in for any changes to take effect.


Example Uses

Example uses of this are somewhat contrived, but still can be useful. None of the examples below are particularlly advocated, they are just examples of what can be done.

Shell Environment Variables

Setting up your shell environment variables differs fairly strongly between sh and csh. If you worked a lot with both shell environments, you could setup your environment for the shells using RCEnvironment, and then not need to do that in the various shell configuration files. The problem of having to re-login to get these changes to take effect does put a damper on this kind of usage, but for many environment variables, they probably wouldn't change often enough to be an issue.

Affecting CVS in ProjectBuilder

ProjectBuilder is one application that can benefit from RCEnvironment. In particular, ProjectBuilder now has builtin CVS support for working with a source repository. However, many people desire CVS to be able to use a different command to access a repository, usually to deal with security issues. Unfortunately, ProjectBuilder does not provide a way to deal with that. By using RCEnvironment, you can setup a CVS_RSH variable which will be passed through ProjectBuilder and to the CVS core to do the proper thing.

Many standard UNIX CLI tools have one or more environment variables that can be setup to modify their behavior similarly to CVS_RSH. If you use or create an application that uses a UNIX CLI tool to perform its work, you may be able to change the way the command works by using the environment to modify some variable it uses. Of course, any changes you make to how the command works using this may cause the calling application to fail if the CLI tool does not work the way it needs to anymore.

Additional Library Paths

In some situations (probably mostly for developers), it might be useful to set the DYLD_FRAMEWORK_PATH and/or DYLD_LIBRARY_PATH (which adds additional directories searched for frameworks and shared libraries respectively) so that these paths are searched for applications or tools launched from the UI.


Feedback

We are very interested in any comments, suggestions, bug reports, or any other feedback on RCEnvironment; please send them to tools@rubicode.com.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

(Or, the short version: If it breaks, you get to keep the pieces. :-) )


History

1.1 Cleaned up code to insure that the user has finished editing a field before saving a file, or aborting editing if they are reverting. Added key sorting, but only when the user is not editing any fields. Added a backup file and ability to revert to it. Added version number information to the info panel and fixed some issues with how the module was named when loaded into System preferences.

1.0 Initial release.


Copyright © 2002 Doug McClure
 
Back
Top