Path: utzoo!attcan!sobmips!uunet!husc6!brutus.cs.uiuc.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!mailrus!purdue!bu-cs!ckd From: ckd@bu-pub.bu.edu (Christopher Davis) Newsgroups: comp.unix.questions Subject: Re: Prompt as Current Directory? Message-ID: <42749@bu-cs.BU.EDU> Date: 16 Nov 89 12:51:42 GMT References: Sender: daemon@bu-cs.BU.EDU Reply-To: ckd@bu-pub.bu.edu (Christopher Davis) Organization: Boston University School of Management Lines: 36 >>>>> On 16 Nov 89 05:56:13 GMT, broadman@paul.rutgers.edu (Alan Broadman) >>>>> said: Alan> I have a (hopefully) simple question. How can you get the UNIX prompt Alan> to always reflect the path to the current directory. Such a prompt Alan> would change with each 'cd ' command. In MS-DOS this is done by the Alan> command : 'prompt $P'. I think this would be most helpful, as Alan> otherwise, the prompt string is quite useless. Depends--what shell are you using? If you're using tcsh (or can chsh to it, or can get your sysadmin to put it up, etc) you can just do what I do: set prompt="%t ckd@%m : %~ %% " which results in something like: 7:47am ckd@bucsf : ~/bin % the %m being the short hostname (hey, you use multiple machines, you start to need these memory joggers when you get old) and the %~ being the magic part that puts the current working directory in there (properly ~-abbreviated when I'm in my own directory tree). See man tcsh, again assuming you can get it set up--it's got other nice stuff, such as emacs-like command line editing (as well as some vi-like editing, I hear, but I wouldn't know... :-), tab completion of commands and filenames, et. al. If you can't get tcsh, let me dig out this unghodly set of aliases I stole from someone (who stole them from someone, who stole them from someone, unto their forefathers before them, yea, verily...) that put the hostname and trailing directory component into the prompt. They wouldn't be hard to hack to put the full cwd in. -- Christopher Davis, BU SMG '90 "Technology is dominated by those who manage what they do not understand."