Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ati.tis.llnl.gov!wade From: wade@ati.tis.llnl.gov (Michael E. Wade) Newsgroups: comp.unix.questions Subject: Re: custom prompt question Message-ID: <22345@tis.llnl.gov> Date: 27 Jul 88 20:52:46 GMT Sender: news@tis.llnl.gov Reply-To: wade@ati.tis.llnl.gov (Michael E. Wade) Organization: Lawrence Livermore National Laboratory, Livermore CA Lines: 27 In article <3371@polyslo.UUCP> cmaccarl@polyslo.CalPoly.EDU (Carl A. MacCarley) writes: >I'm sure this is a dumb question, but here goes: I wanna get my current >working directory printed as part of my prompt. The following doesn't do >it, since cwd is set at login to my root directory. > >set prompt="$cwd \!> " > >How's it done? >Thanx, >-cam How's this: (I know it's busy, but I've really gotten used to it.) set uid=`whoami` set host=`hostname` set prompt="\ ${uid}@${host} [pwd = `pwd`]\ [\!]: " alias cd 'chdir \!* ; set prompt="\\ ${uid}@${host} [pwd = `pwd`]\\ [\\!]: "' alias pushd 'pushd \!* ; set prompt="\\ ${uid}@${host} [pwd = `pwd`]\\ [\\!]: "' alias popd 'popd \!* ; set prompt="\\ ${uid}@${host} [pwd = `pwd`]\\ [\\!]: "'