Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!oberon!nunki.usc.edu!sal50.usc.edu!connet From: connet@sal50.usc.edu (David Connet) Newsgroups: comp.unix.questions Subject: Re: Getting UNIX prompt to display current directory Keywords: UNIX prompt directories pwd Message-ID: <3175@nunki.usc.edu> Date: 22 Mar 89 05:29:26 GMT References: <5582@ncsugn.ncsu.edu> <2187@solo11.cs.vu.nl> Sender: news@nunki.usc.edu Reply-To: connet@sal50.usc.edu (David Connet) Organization: University of Southern California, Los Angeles, CA Lines: 20 In article <2187@solo11.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: . Solution 2 (if your sh has shell functions). . ------------------------------ . c() # you might not be able to name this function `cd' . { . cd $1 .+ PS1="`pwd`> " . } . ------------------------------ . . Solution 3 (if your sh has both shell functions and $PWD). . ------------------------------ . Change the line indicated with `+' to . PS1="$PWD> " Actually you can just get away with PS1="\$PWD: " ^ The backslash is required. The shell (at least ksh) then reevaluates the PS1 each time.