Deutsch   English   Français   Italiano  
<vcr7jb$2kdlf$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Brian Patrie <bpatrie@bellsouth.spamisicky.net>
Newsgroups: comp.unix.shell
Subject: Re: bash prompt question
Date: Mon, 23 Sep 2024 03:07:07 -0500
Organization: an elaborate system of piles and accidents
Lines: 13
Message-ID: <vcr7jb$2kdlf$1@dont-email.me>
References: <vcguof$hca7$1@dont-email.me> <vch1e9$i0sn$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 23 Sep 2024 10:07:08 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="07d469a37aaf4552d36807b0d9e4d9a3";
	logging-data="2766511"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18OgNHOXz7ggSPzlqu47yYaRbv0zh/h5r8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:+jArllVBPIrqf8GpWAu/rfTkZ9M=
In-Reply-To: <vch1e9$i0sn$1@dont-email.me>
Content-Language: en-GB
Bytes: 1582

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.