Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!sri-unix!hplabs!hpcea!hpfcdc!hpfcda!eric From: eric@hpfcda.HP.COM (Eric Flink) Newsgroups: comp.unix.questions Subject: Re: Prompt changing on the fly - Oops Message-ID: <3800002@hpfcda.HP.COM> Date: Wed, 21-Jan-87 12:38:30 EST Article-I.D.: hpfcda.3800002 Posted: Wed Jan 21 12:38:30 1987 Date-Received: Fri, 23-Jan-87 23:35:50 EST References: <432@ethz.UUCP> Organization: Hewlett-Packard, Fort Collins, CO Lines: 18 I like having my current directory name appear in my prompt. The following aliases appear in my .cshrc file: set prompt="(\! $cwd:t) % " alias cd 'set cdmark=$cwd; chdir \!* ; set prompt="(\! $cwd:t) % "' alias pushd 'pushd \!* ; set prompt="(\! $cwd:t) % "' alias popd 'popd; set prompt="(\! $cwd:t) % "' Note: the :t modifier appended to $cwd strips all but the last element of the path name. (Otherwise your prompt might get very long!) I didn't invent these aliases, someone posted the idea to USENET some time back. Using the Korn shell, you can do the same thing with the following: PS1="(! \${PWD##*/}) $ " export PS1