Getting UNIX prompt to display current directory

Brendan Kehoe brendan at jolnet.ORPK.IL.US
Sun Mar 19 15:47:04 AEST 1989


In article <5582 at ncsugn.ncsu.edu> fristens at ncsugn.ncsu.edu (Brian Fristensky) writes:
>                                 Can anyone think of a tricky way?  My
>guess is that it would involve getting pwd output into the shell variable
>$PS1, but that would require somehow getting pwd to execute after each
>command you type. 

 I have this set up in my .kshrc file:

PS1='${PWD##} $LOGNAME>'

 This will give you (for example): /usr/usr1/brendan brendan>
as a prompt. It does *not* work in the Bourne shell..only Korn.

>Brian Fristensky
>Dept. of Botany
>North Carolina State University
>
>nscugn!fristens at mcnc.uucp


-- 
Brendan Kehoe
brendan at cup.portal.com    | GEnie: B.KEHOE  | Oh no! I forgot to say goodbye
brendan at chinet.chi.il.us  | CI$: 71750,2501 |  to my mind!
brendan at jolnet.orpk.il.us | Galaxy: Brendan |                - Abby Normal



More information about the Comp.unix.questions mailing list