Ibolit Ibolit - 1 year ago 139
Bash Question

reloading .profile on FreeBSD causes error

I have installed Google's Go language on FreeBSD 8.1, added the path to the compiler/interpreter to my PATH in .profile and now am trying to reload it.

$ . ~/.profile

And here is what i get:

/usr/local/bin/.: Permission denied.

I also tried to use
instead of
, but that gives an error per line of the file, like
HOME=/root: Command not found.

What can I do about it? And is this the right place to ask such questions?

Answer Source

I believe that the right way to extend the user's path is to edit user's shell configuration file. The default shell in FreeBSD for regular users is tcsh, for which you can use the ~/.cshrc configuration file.

To modify the PATH environment variable, create or edit .cshrc file in your home directory and put there the following example line:

set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)

Then run:

$ source ~/.cshrc

verify your setting with:

$ echo $path /sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /home/danger/bin

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download