Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ms.UUCP Path: utzoo!utcsri!utai!ms!mts From: mts@ms.UUCP (Martin Stanley) Newsgroups: net.unix,net.unix-wizards Subject: Re: Prompt showing current directory (just like DOS) Message-ID: <150@ms.UUCP> Date: Sun, 1-Dec-85 22:23:07 EST Article-I.D.: ms.150 Posted: Sun Dec 1 22:23:07 1985 Date-Received: Mon, 2-Dec-85 08:21:09 EST References: <159@pyuxv.UUCP> Organization: Home Computer of Martin Stanley, Toronto, Ontario Lines: 33 > One of the (few) nice things about PC-DOS is that you can set > your prompt (PS1) to always show your current directory. > > The following little script allows you to do the same thing > in the Korn shell ("ksh") > Well, here's how I did just that under the csh on a UniPlus+ port (System Vr1). It is obviously slower than under BSD since the cwd variable there is maintained by the shell. set CWD = `pwd` set prompt="($CWD) " alias cd chdir \!\* \; set CWD=\`/fast/pwd\` \; set prompt = \"\(\$CWD\) \" While we are at it, I also have a simulation of pushd and popd (from the BSD4.2 csh). They are implemented via aliases and shell files. They too, are considerably slower than the builtin versions, but work fast enough. Send me mail if you want a copy. -- Martin Stanley Department of Computer Science University of Toronto Toronto, ON M5S 1A4 USENET: {decvax,ihnp4,linus,uw-beaver}!utcsri!utai!ms!mts CSNET: mts@toronto ARPANET: mts.toronto@csnet-relay