Re: prompt2

[ Available lists | Index of freebsd-questions | Month of Dec 1998 | Week of 8 Dec 1998 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Bill Hamilton <billh@finsco.com>
Date
8 Dec 1998 11:47:23
Subject
Re: prompt2
Message-ID
366D825B.1C4A3051@finsco.com

References to

[ Hide this part ]
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


Elapsed time: 0.057 seconds