Getting UNIX prompt to display current directory

Brian Fristensky fristens at ncsugn.ncsu.edu
Sun Mar 19 05:25:03 AEST 1989


In MS-DOS there is a very easy way to get the current directory displayed as
part of the prompt  (prompt $p).  In UNIX, there is certainly no
straightforward way to do this.  Can anyone think of a tricky way?  My
guess is that it would involve getting pwd output into the shell variable
$PS1, but that would require somehow getting pwd to execute after each
command you type. 

Your prompt assistance in this matter will be appreciated.
(sorry.)

Brian Fristensky
Dept. of Botany
North Carolina State University

nscugn!fristens at mcnc.uucp



More information about the Comp.unix.questions mailing list