Getting UNIX prompt to display current directory
David Connet
connet at sal50.usc.edu
Wed Mar 22 15:29:26 AEST 1989
In article <2187 at solo11.cs.vu.nl> maart at 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.
More information about the Comp.unix.questions
mailing list