Suppose I have an environment variable defined in .bash_profile like this:
PS1='\[\e[31;1m\][\u@\h \T \w] \[\e[0m\]'
This variable makes my Linux prompt show certain information, like thes:
[jeff@node21 01:48:30 ~]
[jeff@node22 01:48:30 ~]
[jeff@node23 01:48:30 ~]
[jeff@master 01:48:30 ~]
When the word "master" appears, I want to capitalize it (I am not to do any work on that node and I want it to stand out when I forget to
rsh to other nodes).
I can't use
sed on the variable
PS1, because that doesn't contain the word "master" in it.
Ultimately, I want the prompt to be capitalized when I'm on node "master". Is there a way to evaluate variable "PS1", manipulate the string, and then re-assign it so the prompt works?