Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!emory!cambridge.apple.com!bloom-beacon!eru!luth!sunic!mcsun!ukc!strath-cs!cs.glasgow.ac.uk!memex!scott From: scott@memex.co.uk (Scott Williamson) Newsgroups: comp.unix.questions Subject: Re: Re^2: Prompt as Current Directory? Message-ID: <337@memex.co.uk> Date: 21 Nov 89 07:03:15 GMT References: <2114@sactoh0.UUCP> <1989Nov19.180921.20357@ultra.com> Reply-To: scott@memex.co.uk (Scott Williamson) Organization: Memex Ltd., East Kilbride, Scotland Lines: 30 In article <1989Nov19.180921.20357@ultra.com> rmg@ultra.com (Rich Geiger) writes: >>In article >>broadman@paul.rutgers.edu (Alan Broadman) writes: >>> >>>I have a (hopefully) simple question. How can you get the UNIX prompt >>>to always reflect the path to the current directory. > >.................................................... somehow > > /usr/baziotes/projs/releases/source/lint/obj/debug/notes/private % > >as a prompt is somewhat irritating. Doesn't leave much space for >typing a command, either! > My solution is to only have the last two elements of the pathname in the prompt. This still gives a good reminder as to where you are. The following also includes username and hostname eg. scott [doc: src/pcomm] : For .cshrc: set hn=`hostname` alias cd 'cd \!* ; set cwdh = $cwd:h ; set prompt = "$user [${hn}: $cwdh:t/$cwd:t] : "' alias pushd 'pushd \!* ; cd .' alias popd 'popd \!* ; cd .' cd .