Part 2 -An su and prompt question

From: Kathy Ange (kathyange@yahoo.com)
Date: Tue Aug 13 2002 - 09:51:18 EDT


I have received about 10 responses and I guess I
wasn't clear about my situation. I want to use the su
command not the su - command. I don't want to change
the user environment, I don't want my directory to
change, just the authority to change. The su command
is working with the exception of the prompt
automatically changing to a #. Also I forgot to
mention that if I removed the setting for PS1 in the
.kprofile then I receive the $ prior to a su command
and it changes to a # after the su command. The thing
is my user want to see the node mane and the userid
name on the prompt. So the idea situation is a prompt
that looks like this foobar: kange $ before the su
command and foobar: root # after the su command.
However I would be happy if it just changed to a
plain # after the su command. This would let the
users know it worked, which it does they just think it
didn't.

What files does the su command use or read. If I knew
that maybe the answer would be apparent. I have read
the man page, and other documents and also the Sun
Managers archives, but haven't discovered any help
yet.

Original Question
-----------------------------------------------------
My question is how can I make my prompt change when I
su (It will change if I su - root, as it executes the
.profile) The problem is with Solaris 2.8 their isn't
a change so the user thought that su didn't work. For
that reason Solaris 2.6 is a bit better. Any suggests
would be appreciated.

I have two Operating Systems, one is 2.6 and the other
2.8
In both systems I use korn shell and in .profile I
have the following
ENV=.kprofile
export ENV

Then in the .kprofile I have
PS1="`uname -n`: $LOGNAME: "$
export PS1

With Solaris 2.6
foobar:kange: $id
uid=1004(kange) gid=10(staff)

foobar:kange: $pwd
/export/home/kange

foobar:kange: $su
Password:

# id
uid=0(root) gid=1(other)

# pwd
/export/home/kange
#

With Solaris 2.8

foobar2: kange: $id
uid=1001(kange) gid=10(staff)

foobar2: kange: $pwd
/export/home/kange

foobar2: kange: $su
Password:

foobar2: kange: $id
uid=0(root) gid=1(other)

foobar2: kange: $pwd
/export/home/kange
foobar2: kange: $

=====
Kathy Ange
Virginia Department of Agriculture & Consumer Services
Information Systems
(804) 786-1340 Voice Mail
(804) 786-2110 FAX
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:24:46 EDT