Current directory in the ksh prompt?

Michael Stefanik mike at bria.UUCP
Sun Apr 28 19:39:31 AEST 1991


In an article, mju at mudos.ann-arbor.mi.us (Marc Unangst) writes:
>I recently started using ksh, and one thing I miss dearly from csh is
>the ability to put the current directory in your prompt. [...]

My personal favorite is this one (it prints out the basename of the
current directory):

PS1='${PWD##*/}> '

If you want the whole thing, then just use some variation of:

PS1='${PWD}> '

-- 
Michael Stefanik, MGI Inc, Los Angeles | Opinions stated are never realistic
Title of the week: Systems Engineer    | UUCP: ...!uunet!bria!mike
-------------------------------------------------------------------------------
If MS-DOS didn't exist, who would UNIX programmers have to make fun of?



More information about the Comp.unix.shell mailing list