Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site pegasus.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!pegasus!hansen From: hansen@pegasus.UUCP (Tony L. Hansen) Newsgroups: net.unix-wizards Subject: Re: PS1 change (ksh) Message-ID: <2193@pegasus.UUCP> Date: Sat, 23-Mar-85 12:20:28 EST Article-I.D.: pegasus.2193 Posted: Sat Mar 23 12:20:28 1985 Date-Received: Sun, 24-Mar-85 04:06:16 EST References: <245@rruxe.UUCP> <1308@amdahl.UUCP> <530@whuxl.UUCP> Organization: AT&T Information Systems, Lincroft NJ Lines: 28 << how do you get the current directory in the prompt? << < If you want the cwd in the prompt, just make a new function called, say, ch: < < ch() < { < if cd $1;then PS1="[`pwd`] ";fi < } This of course requires you to use the name "ch" instead of "cd" to change directories. More thorough would be to do the following: alias cd=__cd _cd=cd function __cd { _cd $*;PS1="[$PWD] "; } Even better is to do just: PWD='[$PWD] ' and not modify cd at all. This will work in the most recent versions of ksh. < This will work in SVR2 sh as well as ksh. Neither of the above two solutions will work in the SVr2 sh. I don't know if the version of ksh available outside of AT&T supports the second solution. Tony Hansen pegasus!hansen