Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-25-2004, 10:09 PM   #1
Registered: Jun 2004
Location: Florida
Distribution: Gentoo
Posts: 148

Rep: Reputation: 15
Bash and login shells

Is there a way to make all of my bash shells login shells?

I googled a bit and found many documents pointing to ~/.bashrc and ~/.bash_profile, but none of them outlined how to make all of my shells login shells.

Any help would be greatly appreciated.
Old 10-26-2004, 01:18 AM   #2
Senior Member
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
Why do you need all your shells to be login shells?

If you're confronting the issue I think you are (your xterms looking different from your login shells) then let me explain a remedy this way:

your .bashrc is for non-login shells. Non login shells read this file when your term session is begun. So, to make all shells uniform, we make this file point to the sources of information for login shells. My ~/.bashrc looks like this --

source /etc/profile
source ~/.bash_profile
Now, when you start an xterm as a non-login shell, it still reads /etc/profile and your bash_profile to get your login-shell settings. All of your user specific aliases and variables should now go into .bash_profile and they will be read no matter what type of session you are running -- xterm, non-login, login, everything.

Old 10-26-2004, 05:35 AM   #3
Registered: Jun 2004
Location: Florida
Distribution: Gentoo
Posts: 148

Original Poster
Rep: Reputation: 15
That's exactly what I wanted. Thank you.
Old 11-18-2004, 10:21 AM   #4
LQ Newbie
Registered: Nov 2004
Posts: 1

Rep: Reputation: 0
Hello everyone,
i tried to make one program running on linux, and i added following line in the .bash_profile files
export program='/mydir/path'

another changing also have been done in the .bashrc file

source /etc/profile
source ~/.bash_profile

after these changes i logout, then i can not login again, when i log in after input password, it seems cpu will work busy but nothing windows come out?
who knows what's wrong ? and who knows how to resolve this problem!
thanks a lot in advance!
linux new user


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
editing /etc/shells to only allow bash omg-ffs Linux - Newbie 3 12-05-2004 03:20 PM
Is this a bug? (BASH and Z shells) KingofBLASH Linux - Software 4 09-14-2004 06:14 PM
Login shells vs non-login shells lsmith Linux - General 2 03-31-2004 07:29 PM
wait in bash shells raypen Linux - Software 1 04-18-2003 02:19 PM
bash and other linux shells crealkiller175 Linux - General 9 03-02-2003 03:02 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:19 AM.

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