LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > VectorLinux
User Name
Password
VectorLinux This forum is for the discussion of VectorLinux.

Notices


Reply
  Search this Thread
Old 10-22-2013, 05:23 PM   #1
DiscobarMolokai
LQ Newbie
 
Registered: Oct 2013
Distribution: Vectorlinux 7.0
Posts: 6

Rep: Reputation: Disabled
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?
 
Old 10-23-2013, 02:20 AM   #2
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
Hi,

What is your default login shell?

Code:
echo $SHELL;
 
1 members found this post helpful.
Old 10-23-2013, 02:25 AM   #3
DiscobarMolokai
LQ Newbie
 
Registered: Oct 2013
Distribution: Vectorlinux 7.0
Posts: 6

Original Poster
Rep: Reputation: Disabled
Default login shell

It's /bin/bash.
 
Old 10-23-2013, 02:32 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
@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?
 
1 members found this post helpful.
Old 10-23-2013, 03:33 AM   #5
DiscobarMolokai
LQ Newbie
 
Registered: Oct 2013
Distribution: Vectorlinux 7.0
Posts: 6

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-23-2013, 03:50 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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.
 
1 members found this post helpful.
Old 10-23-2013, 05:44 AM   #7
DiscobarMolokai
LQ Newbie
 
Registered: Oct 2013
Distribution: Vectorlinux 7.0
Posts: 6

Original Poster
Rep: Reputation: Disabled
Ok, I got it now. Thanks for the help!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the environment variable permanently in Ubuntu 10.10 anis_huq Linux - Newbie 6 05-01-2011 02:13 AM
Permanently Set Environment Variable LANG Mistro116@yahoo.com Red Hat 1 06-12-2008 08:11 PM
Modifying DISPLAY environment variable on-the-fly ktulu1115 Linux - Software 1 10-07-2005 02:18 PM
Modifying the PATH environment variable brunnopessoa Linux - Newbie 11 11-03-2004 10:23 PM
Store PATH variable permanently Skute Linux - Software 8 01-15-2004 04:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > VectorLinux

All times are GMT -5. The time now is 11:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration