[SOLVED] Problem with modifying PATH environment variable permanently (VectorLinux 7.0)
VectorLinuxThis forum is for the discussion of VectorLinux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
@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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.