Path: utzoo!utgpu!water!watmath!clyde!bellcore!decvax!decwrl!labrea!agate!ucbvax!hplabs!sdcrdcf!ism780c!tim From: tim@ism780c.UUCP (Tim Smith, Knowledgian) Newsgroups: comp.unix.wizards Subject: Re: current pwd in prompt Keywords: :-) Message-ID: <9071@ism780c.UUCP> Date: 17 Feb 88 22:36:56 GMT References: <11657@brl-adm.ARPA> <142700023@occrsh.ATT.COM> Reply-To: tim@ism780c.UUCP (Tim Smith, Knowledgian) Organization: Suction and Pressure Lab, California Institute of Lawsonomy Lines: 43 In article <142700023@occrsh.ATT.COM> rjd@occrsh.ATT.COM writes: < and I am also running ksh for my login, this was the method that I liked the < best. Put into your .profile (or the file that ENV is set to): < < c() { < cd $* < PS1="${PWD}: " < } < < And use "c " to change directories. Here is a function that works with the regular shell. It has some obvious drawbacks, but it sort of works: CD= # holds current directory ccd() { SAVE=$CD if [ $# -eq 0 ] then CD='~' NEW= else NEW=$1 case $NEW in /* ) CD=$NEW ;; * ) CD=$CD/$NEW ;; esac fi if cd $NEW then PS1=$CD else CD=$SAVE fi PS1="$CD " } use "ccd " to change directories. This will show your home directory as '~'. -- Tim Smith tim@ism780c.ism.com "There is no dark side of the force. As a matter of fact, it's all dark"