ksh prompt

Floyd Davidson floyd at ims.alaska.edu
Wed Mar 6 15:03:38 AEST 1991


In article <7365 at mentor.cc.purdue.edu> asg at sage.cc.purdue.edu (The Grand Master) writes:
>In article <57993 at mcdchg.chg.mcd.mot.com> heiby at mcdchg.chg.mcd.mot.com (Ron Heiby) writes:
>}lvc at 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 at ims.alaska.edu   |  Alascom, Inc. pays me
Salcha, AK 99714   |    Univ. of Alaska      |  but not for opinions.



More information about the Comp.unix.shell mailing list