LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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



Reply
 
Search this Thread
Old 02-07-2008, 02:01 PM   #1
Aigarzs
LQ Newbie
 
Registered: Jan 2008
Distribution: Slackware
Posts: 19

Rep: Reputation: 0
Setting PATH variable


Situation is - I need to change system wide variable PATH and LD_LIBRARY_PATH.

Editing file ~/.bashrc works, but only with current user in current bash sesion.

I want to create my own file rc.myrc which is run somewhere in system boot.

I have created rc.myrc and currently testing it.
Running rc.myrc does not permanently change the variables, new values are only available while rc.myrc is running. After finishing rc.myrc, previous values are in place (in the same bash session).

What am I doing wrong?
Should I better put new path for example in /etc/rc.d/rc.S ?
What else scripts set PATH, besides /etc/rc.d/rc.S? (rc.S does not contain full path as it is now)

Using Slackware.
Thank you.
 
Old 02-07-2008, 02:31 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,755
Blog Entries: 1

Rep: Reputation: 238Reputation: 238Reputation: 238
/etc/profile sets PATH system wide (i.e., for every user). ~/.bashrc works for the current user whenever a new Bash shell is spawned including the initial Bash shell on login.
 
Old 02-07-2008, 03:27 PM   #3
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
For normal users, you should use ~/.bash_profile and for global changes, make them in /etc/profile. If you use a distro like Red Hat, Mandriva or openSUSE, you can put global settings in an individual file which you place in the /etc/profile.d directory.
 
  


Reply

Tags
path


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trouble setting PATH variable krutten1986 Suse/Novell 4 09-04-2006 02:21 PM
Setting the path variable for Java Comp. lmellen Programming 4 12-30-2004 10:51 AM
Setting Path Variable for LibXML2 Miyamoto Linux - Software 1 08-19-2003 10:00 AM
Help setting $PATH variable Nylex Linux - General 9 08-09-2003 12:44 PM
setting path variable shahrahulb Linux - General 2 07-30-2003 09:25 PM


All times are GMT -5. The time now is 01:54 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration