Re: Setting PS1 with stock /etc/bashrc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 25, 2003 at 06:36:31PM -0500, Robert G. (Doc) Savage wrote:
> I would like to use the stock logic in /etc/bashrc to implement a
> custom PS1 prompt.
> 
> Can someone please show me how to prefix the following in a
> /etc/sysconfig/bash-prompt-xterm file?
> 
> PS1="\n\\033[1;31m`cat /etc/redhat-release`\n\\033[1;34m\d  \\033[0;32m\t CDT\n\\033[0;36m[\u@\h] \\033[1;33m\w\\033[0;37m\n\\$ "
> 
> Everything I've tried still gives me the stock PS1='[\u@\h \W]\$ '

That's not what /etc/sysconfig/bash-prompt-xterm is expected to do.  If
the /etc/sysconfig/bash-prompt-xterm file exists, it is run before the
prompt is printed.  For all that bash knows, it's a binary file (i.e.,
it is not "sourced" by the shell).

I think you want to either make bash-prompt-xterm just print out the
information you're looking for, or to move the file to /etc/profile.d
and rename it local-prompt.sh or somesuch.

HTH,

Nalin




[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux