Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!pprg.unm.edu!hc!ames!ucsd!sdcsvax!ucsdhub!esosun!seismo!uunet!steinmetz!davidsen From: davidsen@steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.unix.questions Subject: Re: Bourne Shell Question? Message-ID: <13071@steinmetz.ge.com> Date: 2 Feb 89 16:26:07 GMT References: <8517@dasys1.UUCP> <201@carroll1.UUCP> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: General Electric CRD, Schenectady, NY Lines: 18 In recent versions of sh you can use a function with a similar name to do what you want. cwd() { cd $1 && PS1="`pwd`> "; } In ksh you can use the $PWD, as: PS1='$PWD> ' or (my favorite) strip the HOME from the display with: PS1='${PWD#$HOME/}> ' This 2nd form strips the HOME part of the directory when you are in a subdirectory of your HOME directory, and leaves a prompt starting with a driectory name. In all other directories, including HOME, you get the absolute path name, starting with a /. Hope this isn't more info than you wanted. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me