*BSD News Article 29580


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!bunyip.cc.uq.oz.au!harbinger.cc.monash.edu.au!yeshua.marcam.com!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!pipex!zaphod.crihan.fr!univ-lille1.fr!jussieu.fr!centre.univ-orleans.fr!univ-lyon1.fr!ensta!itesec!frmug.fr.net!renux.frmug.fr.net!keltia.frmug.fr.net!not-for-mail
From: roberto@keltia.frmug.fr.net (Ollivier Robert)
Newsgroups: comp.os.386bsd.questions
Subject: Re: pwd in the prompt
Date: 11 Apr 1994 21:00:41 +0200
Organization: A Happy FreeBSD-current Usenet Site
Lines: 35
Message-ID: <2oc6p7$gr@keltia.frmug.fr.net>
References: <2nrmmu$lql@hermes.unt.edu> <ghcPO2q00iM8I0flE9@andrew.cmu.edu> <1994Apr8.132929.9611@gmd.de> <1994Apr11.083609.16557@uts.amdahl.com>
NNTP-Posting-Host: keltia.frmug.fr.net
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

In article <1994Apr11.083609.16557@uts.amdahl.com>,
Alistair G. Crooks <agc@uts.amdahl.com> wrote:
>Yes, I used to do the same, but this fails if you use directory stacks,
>and push and pop directories will both change to the new directory without
>resetting the prompt.

If  you're a csh fan,  switch over to TCSH.  It  has all the features (even
misfeatures :-)) of csh with many many more things like the one you seek.

-rw-r--r--    1 roberto    425904 Jul 17  1993 tcsh-6.04.tar.gz

The  prompt is automatically managed  by tcsh and change   as you play with
pushd/popd/cd/...

The one I use is 

		set prompt="[%S%m%s][%h][%S%.2%s]%# "

It gives you a prompt like this if you'not root

[keltia][201][~]>

and that one

[keltia][201][~]#

when you're root. The %.2 shows you only the last two component of the path
which    is very     useful      when  you're   in    a   directory    like
/usr/src/sys/i386/conf...

>Alistair
-- 
Ollivier ROBERT                          Ollivier.Robert@keltia.frmug.fr.net
A FreeBSD & PERL addict...                PGP 2.3a public key on key-servers 
Running FreeBSD-current and very happy to do so !