Results 1 to 8 of 8
Thread: how to set path
|
Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
-
04-19-2007 #1
- Join Date
- Nov 2006
- Posts
- 46
how to set path
Basically, what i want is to add the new program directories to the default search path. I prefer to use C-shell ( my default shell is bourne shell, i think, and i have to type csh to change to C shell). I looked my .cshrc file. It is pretty simple, only two sentences that I myself created for another program (under the instruction provided by that program). there is no word like "SETENV", "PATH". I don't know how to add the path for my new program. Do I have to be the root?
Can anyone suggest a general method? Thanks! ( I am using Suse 10.0)
-
04-19-2007 #2
- Join Date
- Mar 2007
- Location
- Newcastle, Australia
- Posts
- 80
Probably the easiest thing is to add you $PATH that you wish to speciy in your bashprofile. Your bashprofile is usually in your home dir so /home/user/.bashprofile so
kate ~/.bash_profile
here is mine
# .bash_profile
# Initialize keychain if needed
if [ -r $HOME/.ssh/identity -o -r $HOME/.ssh/id_dsa -o -r $HOME/.ssh/id_rsa ]; then
if [ ! -d $HOME/.keychain ]; then
keychain
fi
fi
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
PATH=$PATH:/home/flebber/Python
export PATH
unset USERNAME
Hope this helps
-
04-19-2007 #3
- Join Date
- Nov 2006
- Posts
- 46
Re:
Thanks. Are you doing this as user or root?
-
04-19-2007 #4
- Join Date
- Mar 2007
- Location
- Newcastle, Australia
- Posts
- 80
Yes no you need to work as root.
-
04-19-2007 #5
I think this article may help you out.
-
04-20-2007 #6
- Join Date
- Apr 2007
- Posts
- 2
If you want to have a system variable set (available to all users) then add what flebber suggested under /etc/profile (at the end of the file) and run as root:
source /etc/profile
Cheers
-
04-24-2007 #7
- Join Date
- Mar 2007
- Posts
- 3
yep, that's a good way to go about doing it.
-
04-25-2007 #8
littlewenwen:
Use one of the following lines in your '.cshrc' file (depending on where in the path you want your directories):
Code:set path = ( <*> $path ) set path = ( $path <*> ) <*> = "list of one or more paths separated by spaces"