Date: Tue, 08 Dec 1998 13:47:39 -0600 From: Bill Hamilton <billh@finsco.com> To: Markus <mennis@ucsd.edu> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: prompt2 Message-ID: <366D825B.1C4A3051@finsco.com> References: <366C3D88.7C67F93E@ucsd.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?366D825B.1C4A3051>
