Korn Shell Question

carroll at snail.CS.UIUC.EDU carroll at snail.CS.UIUC.EDU
Fri Oct 31 02:56:00 AEST 1986


	Ah! Finally a question I know something about. We have tried several
solutions here, and the one that we think works the best is to put into
your .kshrc (remember, to make that work in Kshell, you must have ENV set and
exported to the filename):

ChangeDir=cd
function change_dir
    {
    $ChangeDir $*
    PS1="(!:${PWD}) "
    }
alias cd=change_dir
cd .

	Using a variable to the cd inside the funtion is needed so that when
the .kshrc is re-executed, you don't get a "recursive function" error. Doing
the cd . changes the prompt to be right immediately after .kshrc executes.



More information about the Comp.unix mailing list