PS1 to show relitive path

Hi I am trying to format my prompt in a KSH to show the relative path
currently it is PS1='$PWD >' /home/users/dir/dir/dir >
I want to display it as /home/users/.../.../dir > :rolleyes:

You can have fun with your PS1 prompt by creating a function which changes PS1 each time you change directory, e.g...

function ncd {
   cd "$*"
   PS1=$(echo $PWD|sed 's!\([^/]\)[^/]\{4,\}/!\1../!g')' :> '
}
alias cd=ncd

Thanks that helped a lot