Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!noao!ncar!csn!magnus.ircc.ohio-state.edu!zaphod.mps.ohio-state.edu!think.com!paperboy!hsdndev!husc6!purdue!mentor.cc.purdue.edu!sage.cc.purdue.edu!asg From: asg@sage.cc.purdue.edu (The Grand Master) Newsgroups: comp.unix.shell Subject: Re: ksh prompt Message-ID: <7365@mentor.cc.purdue.edu> Date: 6 Mar 91 02:11:16 GMT References: <1772@brchh104.bnr.ca> <1991Feb28.173758.21195@en.ecn.purdue.edu> <57517@mcdchg.chg.mcd.mot.com> <1991Mar4.133215.12269@cbnews.att.com> <57993@mcdchg.chg.mcd.mot.com> Sender: news@mentor.cc.purdue.edu Reply-To: asg@sage.cc.purdue.edu (The Grand Master) Organization: Purdue University Lines: 31 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. Bruce --------- sar.casm \'sa:r-.kaz-*m\ \sa:r-'kas-tik\ \-ti-k(*-)le-\ n [F sarcasme, fr. LL sarcasmos, fr. Gk sarkasmos, fr. sarkazein to tear flesh, bite the lips in rage, sneer, fr. sark-, sarx flesh; akin to Av thwar*s to cut] 1: a cutting, hostile, or contemptuous remark : GIBE 2: the use of caustic or ironic language - sar.cas.tic aj ### ## Courtesy of Bruce Varney ### # aka -> The Grand Master # asg@sage.cc.purdue.edu ### ##### # PUCC ### # ;-) # # ;'> # ##