Ixthusdan Posted June 4, 2003 Report Share Posted June 4, 2003 In my Mandrake terminal, I have the user and directory info: dan@gamer#dan if I am in the /home/dan directory. But in gentoo, I have bash-2.05b# irregardless of where I am. I can't even tell if I left terminal in superuser mode. How do I cahnge gentoo to match Mandrake? Quote Link to comment Share on other sites More sharing options...
Cannonfodder Posted June 4, 2003 Report Share Posted June 4, 2003 Try googlling linux prompt Eventually you will have to figure where gentoo is setting this prompt up and modify it or modify your /etc/profile to modify your prompt after the fact.. E.g. PS1='u w $' Do a set | more and look for PS1.. Quote Link to comment Share on other sites More sharing options...
paul Posted June 4, 2003 Report Share Posted June 4, 2003 try doing this source /etc/profile or to automate it ... try running xterm -ls (login shell) I use Eterm ... and in the configuration of Eterm I ticked the box that said Enable login Shell (or something like that) Quote Link to comment Share on other sites More sharing options...
Ixthusdan Posted June 5, 2003 Author Report Share Posted June 5, 2003 Thanks, Paul, that works for the session. The xterm thing doesn't do it, so I'll have to figure out where my gentoo terminal configuration is. Quote Link to comment Share on other sites More sharing options...
tyme Posted June 5, 2003 Report Share Posted June 5, 2003 .bashrc holds the terminal configuration options in gentoo. there is a sample file somewhere, i believe in /etc...i'll check when i get home. Quote Link to comment Share on other sites More sharing options...
paul Posted June 5, 2003 Report Share Posted June 5, 2003 actually tyme is right ... but for some reason I could never get my .bashrc to load :-| do man xterm and find out what the params is for login shell the terminal I found that doesn't have a login params is konsole Quote Link to comment Share on other sites More sharing options...
bvc Posted June 5, 2003 Report Share Posted June 5, 2003 /etc/bashrc is the global....overwritten by ~/.bashrc. You can also put it in ~/.bash_profile if you put source ~/.bash_profile in ~/.bashrc Quote Link to comment Share on other sites More sharing options...
Ixthusdan Posted June 6, 2003 Author Report Share Posted June 6, 2003 I did something wrong. I put the line in ~/.bashrc and lost all function in terminal. I had to go to root and remove the change. Are you sure about the instructions? Quote Link to comment Share on other sites More sharing options...
tyme Posted June 6, 2003 Report Share Posted June 6, 2003 the example .bashrc i was talking about is in /etc/skel/ i have no problem with my ~/.bashrc on my gentoo system....are you sure what you added to your file was valid? p.s.-for some info on this and various links regarding making your own prompt see this thead Quote Link to comment Share on other sites More sharing options...
Cannonfodder Posted June 6, 2003 Report Share Posted June 6, 2003 Another idea is to put the file in /etc/profile.d Make sure its chmod 755 and it should load everytime.. No need to call it from anywhere as anything in profile.d is automatically executed each time you open a term.. Quote Link to comment Share on other sites More sharing options...
static Posted June 6, 2003 Report Share Posted June 6, 2003 I'm intrigued to find out how to fix this for various distributions, mainly live bootable cds that I carry around that I like to customize before burning to add my passwords, bookmarks, etc. Quote Link to comment Share on other sites More sharing options...
bvc Posted June 6, 2003 Report Share Posted June 6, 2003 I'm sure it works, but not exactly what the sum of it means as far as priority. Meaning, I think you're basically saying 'anything in .bash_profile overrides anything in .bashrc'. I'm sure the man or info pages say. I had the same prob in LFS and had to edit from init 1. I basically just #commented stuff out of .bash_profile. Quote Link to comment Share on other sites More sharing options...
aru Posted June 6, 2003 Report Share Posted June 6, 2003 I'm not sure what is the problem here. A login shell sources .profile (or .bash_profile) A non login shell sources .bashrc So depending on what kind of bash session you are you'll have one or another environment. Then depends on the user to have the *same* environment always. Since a non login shell inherits its environment from its parent shell, in theory you have nothing to do. The difference is with login shells which unless you put it they won't read and execute the settings on ~/.bashrc (Mandrake does it by default, but other distros don't). The usual solution is to add some thing like this in your .profile or .bash_profile (depending on what you have): [ -f ~/.bashrc ] && . ~/.bashrc This is how bash read (in interactive sessions) its config files (and that depends only on bash, not on the distro): Login shell First, reads and executes commands from /etc/profile; then looks for users's ~/.bash_profile, ~/.bash_login, OR ~/.profile; in that order, and only reads and executes the code of the first one found. Non Login shell: (ie a subshell; for example a non-login xterm). It reads and executes commands from users ~/.bashrc So if you want the same behaviour you have in Mandrake, you should edit your bash config files using the mandrake ones as a model (ie, sourcing ~/.bashrc from ~/.bash_profile, and sourcing /etc/bashrc from ~/.bashrc; also you should source the files in /etc/profile.d either from /etc/bashrc and from /etc/profile in orther to have those settings available independently of the kind of shell session). HTH Quote Link to comment Share on other sites More sharing options...
Ixthusdan Posted June 6, 2003 Author Report Share Posted June 6, 2003 I'm sure the answer is already on this thread but I don't know how to execute it. aru, the line of code you listed does indeed already exist in ~/bash.profile. If I type source /etc/profile , I get the prompt that I want, even with color. But I do not understand how to automate this process. I thought I was supposed to add this line to ~/bashrc, but when I did, Igot a terminal with nothing in it, except it would echo whatever I typed! Could you tell me exactly where to put this line? Quote Link to comment Share on other sites More sharing options...
aru Posted June 6, 2003 Report Share Posted June 6, 2003 Are you by any chance using KDE? If so, read: http://www.mandrakeusers.org/viewtopic.php?t=1898 (Shell prompt problem Reposted from Old board) http://www.mandrakeusers.org/viewtopic.php?t=4102 (Konsole not reading .bash_profile) Also check that your login shell is bash and not sh (that is also commented in one of the above threads) HTH Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.