Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!labrea!csli!gandalf From: gandalf@csli.STANFORD.EDU (Juergen Wagner) Newsgroups: comp.unix.questions Subject: Re: Getting UNIX prompt to display current directory Message-ID: <8186@csli.STANFORD.EDU> Date: 19 Mar 89 10:11:45 GMT References: <5582@ncsugn.ncsu.edu> Sender: gandalf@csli.Stanford.EDU (Juergen Wagner) Reply-To: gandalf@csli.stanford.edu (Juergen Wagner) Organization: Center for the Study of Language and Information, Stanford U. Lines: 20 Ok, guys. It's prompt time again. The answers to the question are: (1) It depends on your shell (csh, sh, tcsh, ksh, ...). (2) The trick is not to update the prompt after every command but only after commands changing the current working directory. In csh, you can alias cd, pushd, popd, etc., so they set the csh variable "prompt" properly. In tcsh, you can specify something like set prompt = "${HOSTNAME}:%d(%h)${dot} " to include the proper working dir in the prompt. Your mileage may vary. It should be all in TFM for your favourite shell. (3) This question arises every 6 months or so, and promptly causes prompt wars. (4) Typically about a month after the original posting, after all variations have been stated, somebody asks for a repost. Enjoy, -- Juergen Wagner gandalf@csli.stanford.edu wagner@arisia.xerox.com