I need to color bash on multiple linux servers, I'm creating ps1_color.sh file in /etc/profile.d/ with code below:
if [ "$PS1" ]; then PS1="\[\e[;32m\]*PRE-PROD* [\u@\h \W]\\$ \[\e[m\]" fi
The problem is being in an automation that is used in some servers, they use an ssh.jar to loop access to several servers with a certain user and execute a command on these servers, however, every time I put this code in the PS1 it does not execute automation, when I remove or put the standard linux code on the PS1, it works normally.
What could be wrong with the code? Or does anyone have any other ideas of what might be going on?
All servers use Red Hat Enterprise in different versions.
thanks
I put the PS1 code without the if condition
Putting the default code [\u@\h \W]\$ works normally