Sujet : Re: bash prompt question
De : bpatrie (at) *nospam* bellsouth.spamisicky.net (Brian Patrie)
Groupes : comp.unix.shellDate : 23. Sep 2024, 10:07:07
Autres entêtes
Organisation : an elaborate system of piles and accidents
Message-ID : <vcr7jb$2kdlf$1@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
Chris Elvidge wrote:
> try export PS1='\[\e[1;35m\]\u@\h -\d- ${text} \W\[\e[00m\]\$ '
In bash (and most shells), PS1, etc do not need to be exported; as long as they're set in .bashrc, they will be set in every interactive bash session. Moreover, exporting them will make a mess in sh:
$ export PS1='\[\e[1;35m\]\u@\h -\d- ${text} \W\[\e[00m\]\$ '
foh@enceladus -Mon Sep 23- ~$ sh
\[\e[1;35m\]\u@\h -\d- \W\[\e[00m\]$
sh (and its clones)--which don't support an rc file--are, of course, the exception to this rule.