Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site pyuxv.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!pyuxww!pyuxv!cim2 From: cim2@pyuxv.UUCP (Robert L. Fair) Newsgroups: net.unix,net.unix-wizards Subject: Prompt showing current directory (just like DOS) Message-ID: <159@pyuxv.UUCP> Date: Tue, 26-Nov-85 10:08:28 EST Article-I.D.: pyuxv.159 Posted: Tue Nov 26 10:08:28 1985 Date-Received: Wed, 27-Nov-85 06:23:42 EST Organization: CHC Lines: 34 Xref: watmath net.unix:6385 net.unix-wizards:15867 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") The lines should be put in your '.kshrc' file or equivilent, and THE ORDER IS SIGNIFICANT. This works because "ksh" evaluates aliases before builtins/functions. Note that although the function is called 'ncd' (to avoid conflict with the built-in 'cd'), the alias allows one to still do "cd $HOME" etc: function ncd { alias cd=cd cd $1 PS1="! $PWD >" alias cd=ncd } alias cd=ncd PS1=$PWD Since everthing here is a built-in, the speed is comparable to a regular 'cd' Anyone know how to get a constant time display in the prompt also ??? Robert L. Fair Bell Communications Research/ C.H.C Piscataway N.J. (pyuxv!cim2) >>> To Boldly love a maniac linguist, is that not a thing of beauty ????