Problem with modifying PATH environment variable permanently (VectorLinux 7.0)
Hello everyone,
I have some troubles with permanently setting my PATH env var in VectorLinux (7.0). I know that I should add some lines like these to ~/.bash_profile: PATH=$PATH:/mypath/ export PATH So now, the path should be modified whenever I'm working in bash. But it does not change. Even after rebooting echo $PATH always gives me the same default PATH in a bash. I also tried editing ~/profile and /etc/profile (in the latter I even inserted my own path directly into the command that creates PATH) only to find that I can never start a terminal without having the PATH set to the default. The only thing that works so far is typing source ~/.bash_profile when I start a terminal, then echoing $PATH shows the changes I want to be permanent. I have to do so every time. What am I doing wrong? |
Hi,
What is your default login shell? Code:
echo $SHELL; |
Default login shell
It's /bin/bash.
|
@ilesterg: The SHELL variable is bash/ksh specific and will not be set/changed when using, for example, zsh or csh. A better way to determine the login shell is to look in /etc/passwd (grep <username> /etc/passwd).
@DiscobarMolokai: You should only need to edit your ~/.bashrc file if you need to modify this path for some reason. Is this done for a normal user or for the root user? |
A normal user. I just need the shell to find some small programs I frequently use, stored in a directory that's not in the default PATH, without having to type the entire path to them every time. I'll try adding the lines to ~/.bashrc and I'll post if it worked. Thanks
|
The file that are used when logging in depends on
Interactive login shell: /etc/profile and ~/.bash_profile and ~/.profile You often see this: - /etc/profile parses /etc/ash.bashrc - ~/.profile parses ~/.bashrc Interactive non-login shell: /etc/bash.bashrc and ~/.bashrc The system wide PATH is normally set in /etc/profile and assuming that ~/.bashrc is parsed from ~/.profile; ~/.bashrc should be used to add localized PATH settings. One thing that just comes to mind: Where in the file did you add the PATH=... / export PATH lines? Make sure these are set after the normal PATH= commands. |
Ok, I got it now. Thanks for the help!
|
All times are GMT -5. The time now is 12:00 PM. |