Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!hayes.ims.alaska.edu!floyd From: floyd@ims.alaska.edu (Floyd Davidson) Newsgroups: comp.unix.shell Subject: Re: ksh prompt Message-ID: <1991Mar6.050338.7038@ims.alaska.edu> Date: 6 Mar 91 05:03:38 GMT References: <1991Mar4.133215.12269@cbnews.att.com> <57993@mcdchg.chg.mcd.mot.com> <7365@mentor.cc.purdue.edu> Organization: University of Alaska, Institute of Marine Science Lines: 25 In article <7365@mentor.cc.purdue.edu> asg@sage.cc.purdue.edu (The Grand Master) writes: >In article <57993@mcdchg.chg.mcd.mot.com> heiby@mcdchg.chg.mcd.mot.com (Ron Heiby) writes: >}lvc@cbnews.att.com (lawrence.v.cipriani) writes: >}>I suggest the cd in function ch be quoted: >} >}> function ch { >}> if "cd" ${*:-''} >}... >}>so that a second ". $ENV" will not see 'ch' inside of function ch. >WHY DO YOU WANT TO MAKE IT SO HARD????? >The $PWD variable changes when you cd. >ksh provides for another eval of the prompt string before printing it, >so all you have to do is quote the $ in $PWD like this: >PS1="\$PWD ->" >this will give you a prompt that includes the current directory and >is dynamic - and it is alot easier than a whole bunch of >kludged functions. PS1='$PWD ->' Floyd -- Floyd L. Davidson | floyd@ims.alaska.edu | Alascom, Inc. pays me Salcha, AK 99714 | Univ. of Alaska | but not for opinions.