If you use the korn shell (ksh), you can put the following function into
your .env file.
It works for all 3 formats of cd.
Note that PS0 ... PS4 are standard. PSH is one I made up.
PS0='!: '
PSH=$(hostname)
# function to change directories and reset prompt
.........................
function _cd {
if (($#==0))
then
'cd'
PS1="$PSH:$PWD>"
fi
if (($#==1))
then
'cd' $1
PS1="$PSH:$PWD>"
fi
if (($#==2))
then
'cd' $1 $2
PS1="$PSH:$PWD>"
fi
}
# alias cd to be the _cd function
alias -x cd=_cd
# export the _cd function
typeset -fx _cd
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message