PS1 change (ksh)

Dwight Ernest dwight at timeinc.UUCP
Sun Mar 24 13:03:20 AEST 1985


We don't have ksh, but I have used it while guesting at other
sites. The following used to be part of my .env file under
ksh while I was guesting, and it worked beautifully:

alias lo="off"
function nd {
ldpwd=`pwd`
cd $1 $2 >/dev/null
LDPWD=$ldpwd
PS1="
(! $UNAME `pwd`)
\$>"
PS2="
(! $UNAME `pwd`)
\$\$>"
PS3="
(! $UNAME `pwd`)
select one>"
	;}
alias cd=nd

Note the last alias. I has to follow immediately after the function
definition ends. Also note that my .profile set UNAME=`uname -n`.
And note also that this was System 5 Release 2.0. So my prompt
would appear as:

(32 sysname /current/working/directory)
$>

Where '32' is an example command number from the .history file.
I included sysname from uname in my prompt because I had logins
in so many different systems at the time.

This way, you just use 'cd' like you always did, and, "voila!"



More information about the Comp.unix.wizards mailing list