Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-15-2012, 09:49 AM
|
#1
|
|
Member
Registered: Apr 2008
Distribution: MontaVista Linux Version 4.0.1, Professional Edition
Posts: 211
Rep:
|
setting PATH variable.
I have SUSE Linux and I'm trying to set my path variable.
I have added:
Code:
PATH=$PATH:/home/mynewDirectory/
export PATH
When I echo $PATH this is now appended to the PATH variable.
I want this to remain always so I added the above to both the
Code:
/home/username/.bashrc
/home/username/.profile
But when I start up a new shell using putty I see that the PATH is not set to what I want.
Why is this??
|
|
|
|
08-15-2012, 11:13 AM
|
#2
|
|
LQ Newbie
Registered: Aug 2012
Location: India
Posts: 2
Rep: 
|
Hi
It might be the case that your profile file is one of the those in which you had made entries.
Please let us know the output of this in your login shell:
Guru.
|
|
|
|
08-15-2012, 11:34 AM
|
#3
|
|
Member
Registered: Apr 2008
Distribution: MontaVista Linux Version 4.0.1, Professional Edition
Posts: 211
Original Poster
Rep:
|
|
|
|
|
08-15-2012, 11:38 AM
|
#4
|
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 1,314
|
Do you have additional initialization files like ~/.bash_profile or ~/.bash_login?
|
|
|
|
08-15-2012, 12:10 PM
|
#5
|
|
Member
Registered: Apr 2008
Distribution: MontaVista Linux Version 4.0.1, Professional Edition
Posts: 211
Original Poster
Rep:
|
nope just .bash_history
Thanks
|
|
|
|
08-15-2012, 01:27 PM
|
#6
|
|
Guru
Registered: Aug 2005
Posts: 9,537
|
opensuse 12.1 uses a "local" version of those files
Quote:
# /etc/profile for SuSE Linux
#
# PLEASE DO NOT CHANGE /etc/profile. There are chances that your changes
# will be lost during system upgrades. Instead use /etc/profile.local for
# your local settings, favourite global aliases, VISUAL and EDITOR
# variables, etc ...
|
so please EDIT that file and NOT this one
edit "/etc/profile.local"
the same goes for
Quote:
# /etc/bash.bashrc for SuSE Linux
#
# PLEASE DO NOT CHANGE /etc/bash.bashrc There are chances that your changes
# will be lost during system upgrades. Instead use /etc/bash.bashrc.local
# for bash or /etc/ksh.kshrc.local for ksh or /etc/zsh.zshrc.local for the
# zsh or /etc/ash.ashrc.local for the plain ash bourne shell for your local
# settings, favourite global aliases, VISUAL and EDITOR variables, etc ...
|
suse makes use OF TONES and TONES of scripts that will REWRITE those std files
|
|
|
|
08-15-2012, 01:37 PM
|
#7
|
|
Member
Registered: Jun 2005
Location: England
Distribution: SLED, openSUSE
Posts: 982
Rep: 
|
If you edit the files in /etc/ as John VV suggests that will apply the setting for all users.
If you just want to do it for your own usercode then make yourself a .bash_profile file and put the PATH declaration in there. Making it a per-user setting has the advantage over modifying things in /etc/ that if you back up your home directory, wipe your machine, re-install it and then copy your home directory back, you still have that setting.
This article, http://www.joshstaiger.org/archives/...rofile_vs.html amongst many others explains when .bashrc is parsed and when .bash_profile is parsed.
Last edited by arizonagroovejet; 08-15-2012 at 01:38 PM.
Reason: formatting fixes
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:27 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|