> On Feb 23, 2008, at 6:29 PM, Jay Hart wrote: > >> I use bash as my shell. >> >> I'm trying to set the bash prompt to display: >> >> ttyC1 [EMAIL PROTECTED] >> >> I've created a .bashrc in the users home directory (in this case >> root), and >> used the following line: >> >> PS1="\l [EMAIL PROTECTED] #" > > So, what happens when you can't log in to the system, delete the bash > package or lose your /usr/local/ filesystem? I'd suggest not using > that as your root login shell.
I'll have to rescue the system if I can't login as root. If I lose my /usr/local filesystem, I've probably lost the drive too. I guess I have to ensure that I don't delete the bash package. > >> When I login as root, or any other user for that matter, the default >> prompt is: >> >> -bash-3.2# > > Try the system bashrc, or fire use .bash_profile. Created .bash_profile, same behavior. > >> the only way so far that I found to change the prompt is to type >> 'bash' at the >> prompt after login. This is ok, but I know that this should work the >> first >> time I login, without having to issue a standalone command. > > From the bash(1) 3.2 man page: > > When bash is invoked as an interactive login shell, or as > a non-interactive shell with the --login option, it first > reads and executes commands from the file /etc/profile, if > that file exists. After reading that file, it looks for > ~/.bash_profile, ~/.bash_login, and ~/.profile, in that > order, and reads and executes commands from the first one > that exists and is readable. The --noprofile option may > be used when the shell is started to inhibit this behav- > ior. > >> >> I've come to the conclusion that I need to modify another file >> within the /etc directory, but what? > > So, what lead to that conclusion? Probably not the man page. > I've looked at or modified every file in roots and one users home directory without having the prompt displayed upon initial login. Once I login, and run 'bash', the prompt will be displayed as I set it. This leads me to believe that I have an initial file to set which is being read as part of the init of the box. Jay