*BSD News Article 82317


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.mel.connect.com.au!esmeralda.access.net.au!news.netspace.net.au!news.mira.net.au!inquo!in-news.erinet.com!ddsw1!news.mcs.net!www.nntp.primenet.com!nntp.primenet.com!howland.erols.net!EU.net!news2.EUnet.fr!newsbr.eunet.fr!usenet
From: Frederic.Marand@osinet.fr (Frederic MARAND)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Prompt won't show `pwd`
Date: Mon, 04 Nov 1996 21:09:40 GMT
Organization: Groupe SEDI / Agorus SA / OSI SARL
Lines: 23
Message-ID: <55lpis$20h@newsbr.eunet.fr>
References: <327D7D20.1467@auburn.campus.mci.net>
NNTP-Posting-Host: 193.107.196.155
X-Newsreader: Forte Free Agent 1.0.82

Anthony Jenkins <ajenkins@auburn.campus.mci.net> wrote:

>How do I get my shell prompt (csh or sh) to show the current working
>directory every time it is printed?  Setting prompt to "`pwd`#" only
>sets the prompt to the directory I am in when I issue the set command;
>cd-ing to another directory doesn't affect the prompt.  Thanks in
>advance.
Using ksh, you can do the following:

export PS1='$PWD'"# "

The quotes around $PWD are standard quotes, not backquotes.

Using csh, the usual method is to define an alias for cd that will be
called at each cd call instead of the builtin cd. The alias will
perform the cd and reset PS1.

-------------------------
   Frederic G. MARAND
  Agorus SA / OSI SARL
Frederic.Marand@osinet.fr
-------------------------