Path: utzoo!attcan!uunet!lll-winken!csd4.milw.wisc.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!shelby!lindy!news From: news@lindy.Stanford.EDU (News Service) Newsgroups: comp.unix.questions Subject: Re: Getting UNIX prompt to display current directory Message-ID: <2455@lindy.Stanford.EDU> Date: 19 Mar 89 00:24:29 GMT References: <5582@ncsugn.ncsu.edu> Sender: news@lindy.Stanford.EDU (News Service) Organization: Stanford Data Center Lines: 19 In-reply-to: fristens@ncsugn.ncsu.edu's message of 18 Mar 89 19:25:03 GMT ) 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 favorite answer to this perennial question: PS1=. "I tried that and it didn't work ..." Call for votes for comp.unix.newusers, anyone? In shells that allow aliases or functions, the usual trick is to redefine the commands that let you change your current directory (cd, pushd, popd, ...) so they also change $PS1 or $prompt or whatever. If I'm not mistaken, ksh also allows a better way to do this. In any case, a year's worth of archive of this newsgroup would doubtless turn up a "wealth" of responses, for any given year.