Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpwala!cfisun!ima!mirror!necntc!necssd!necbsd!gilbert From: gilbert@necbsd.NEC.COM (Russell Gilbert) Newsgroups: comp.unix.questions Subject: Re: Getting UNIX prompt to display current directory (Answers) Message-ID: <87@necbsd.NEC.COM> Date: 20 Mar 89 19:09:10 GMT References: <2455@lindy.Stanford.EDU> Organization: NEC America Inc. Lines: 15 From article <2455@lindy.Stanford.EDU>, by news@lindy.Stanford.EDU (News Service): > ) 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? In K-shell, in my .profile, I use: PS1='$PWD> ' In C-shell, in my .login, I use: if ($?prompt) then set X=`pwd` set prompt="$X>C> " alias cd 'cd \!*; set X=`pwd`; set prompt = "$X> "' RG