*BSD News Article 53484


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!uwm.edu!chi-news.cic.net!newsfeed.internetmci.com!EU.net!Germany.EU.net!zib-berlin.de!irz401!uriah.heep!not-for-mail
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: DOS Style shell prompt
Date: 21 Oct 1995 12:34:41 +0100
Organization: Private FreeBSD site, Dresden.
Lines: 25
Message-ID: <46alsh$gil@uriah.heep.sax.de>
References: <814126352.7670@kiss.demon.co.uk> <466bek$l5r@agate.berkeley.edu>
NNTP-Posting-Host: uriah.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Michael Constant <mconst@soda.CSUA.Berkeley.EDU> wrote:

>You can do it easily in tcsh by putting the proper sequences in your prompt
>(RTFM), and you can hack it in any shell like this:
>
>alias cd 'cd \!* ; set prompt = `pwd`"% "'

Or for plain /bin/sh, best do it as a shell function from inside
~/.profile (or $ENV, if you prefer this):

$ cd()
> {
>       chdir ${1:-${HOME}}
>       PS1="$(pwd)» "
> }
$ cd
/home/joerg» cd /tmp
/tmp» cd /usr/local/bin
/usr/local/bin» ^D

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)