Korn Shell Question
Adam V. Reed
adam at mtund.UUCP
Sun Nov 2 14:27:50 AEST 1986
> I have a Korn Shell question that perhaps someone can answer. I like to
> have as my system prompt my current path. When I use csh, I set up my
> .cshrc file with these entries:
>
> set prompt = "! `pwd`}" -- this establishes my prompt as my command number
> and current path when i first initiate the shell
>
> alias cd 'chdir \!:1; set prompt=\!\`pwd`}\'
> this sets up my cd command to not only change
> my working directory but to change the prompt.
>
> I would like to have something similar to this in ksh but I'm not sure how
> to change PSx on the fly. Has someone done something similar to this??
>
> |# J. Michael Flanery #|
Ksh maintains the path of the working directory in $PWD, so you can use
PS1='! $PWD $ '
which gives you the history file line number, the path of the working
directory, and "$ " to remind you you're using ksh.
Adam Reed (ihnp4!mtund!adam||attmail!adamreed)
More information about the Comp.unix
mailing list