LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-27-2004, 06:06 PM   #1
jonty_11
Member
 
Registered: Sep 2004
Posts: 127

Rep: Reputation: 15
Login Profile


Which file do I have to change for a user to have his LD_LIBRARY_PATH and PATH variables set automatically when he logs in....
.bash_profile doesnt work
.bashrc doesnt work......

Is there any other file.....
 
Old 10-27-2004, 09:27 PM   #2
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 35
Either should work as long as your user is indeed using the bash shell.

You are setting the path like this right?

export PATH=$PATH:newdir:another/new/dir etc etc
 
Old 10-27-2004, 11:16 PM   #3
tonyfreeman
Member
 
Registered: Sep 2003
Location: Fort worth, TX
Distribution: Debian testing 64bit at home, EL5 32/64bit at work.
Posts: 196

Rep: Reputation: 30
I have a system where users use different shells ... there are two files that get read by all of them: .login and .profile. If your users do not have a .login file or a .profile then the system defaults are located in /etc/login and /etc/profile .... you can set the environmental variables in the system wide login/profile files or you can simply create the the user .login/.profile files in the user's home directory.

-- Tony
 
Old 10-28-2004, 12:51 PM   #4
jonty_11
Member
 
Registered: Sep 2004
Posts: 127

Original Poster
Rep: Reputation: 15
AMFOSTER: yes i am setting path just like that....

Tony: I was able to do it within the .bashrc file finally.....

But how does the system know which file to use....if I were to create a .login file for my user...will that be used or will .bashrc be used...
 
Old 10-28-2004, 02:45 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
Have a read in

man bash
/^INVOCATION



Cheers,
Tink
 
Old 10-28-2004, 05:14 PM   #6
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 35
bash reads .bash_profile and .bashec
ksh reads .profile and .kshrc (.kshrc is default)
csh reads .login and .cshrc

I like to simply create a .profile and a .login file with the following statement in each of them:

if [ -f ~/.bash_profile ]
then
. ~/.bash_profile
fi


that can also be done like this:

[ -f ~/.bash_profile ] && . ~/.bash_profile

That way no matter which shell I use, I will simply be reading whatever is in the .bash_profile

Of course you can come up with your own way as well.
 
Old 10-28-2004, 05:17 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
Quote:
Originally posted by amfoster
bash reads .bash_profile and .bashec
ksh reads .profile and .kshrc (.kshrc is default)
csh reads .login and .cshrc
That's not only overly simplistic, that's just plain
wrong ... maybe you want to read
man bash
/^INVOCATION
too?


Cheers,
Tink
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Login profile option Bebo LQ Suggestions & Feedback 1 10-19-2004 08:41 AM
about the login profile ust Linux - Software 2 02-02-2004 09:43 PM
Where to find .profile or .login? sceadu Linux - Newbie 2 03-21-2003 12:06 AM
login profile problum in windows 2000 to redhat 7.3 prashu_bvp Linux - Networking 3 10-22-2002 08:22 AM
.profile .login albean Linux - Newbie 4 10-04-2002 08:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:40 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration