On Feb 23 21:29:57, 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] #"
> 
> When I login as root, or any other user for that matter, the default prompt 
> is:
> 
> -bash-3.2#
> 
> 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.

Read man bash again and pay extra attention to the INVOCATION section.

         When an interactive shell that is not  a  login  shell  is
         started,  bash reads and executes commands from ~/.bashrc, if
         that file exists.  This may be inhibited by using  the --norc
         option.   The --rcfile file option will force bash to  read
         and  execute  commands from  file  instead   of ~/.bashrc.

See? An "interactive shell that is not a login shell". The first shell
is not the case, the second is.

> I've come to the conclusion that I need to modify another file within
> the /etc directory, but what?

You don't need to change anything under /etc
to make a modification for one given user.

(BTW, you are not "changing bash prompt escape sequences"
but changing the bash "prompt string".)

        Jan

Reply via email to