Summary An su and prompt question

From: Kathy Ange <>
Date: Tue Aug 13 2002 - 13:46:31 EDT
I want to say Thanks you to everyone who responded.  

Larry Snyder" <>
Doug Winter" <>
Markham, Richard" <>
Alex Stade" <>
Harrington, David B (Contractor)"
Bill Voight" <> 
Johan Hartzenberg" <
Hichael Morton" <>
Doug Floer" <>
Thomas M. Payerle" <
Patrick O'Reilly" <> 
Gavin McDonald" <

I simply moved the PS1 definition from my
$HOME/.kprofile to either the $HOME/.profile or to
/etc/profile, and it worked.  I don't understand why
it didn't work in my korn shell script (names
.kprofile)  but I am happy.  

foobar: kange: $su
# id
uid=0(root) gid=1(other)

Larry suggested Can one of the alternate prompt
strings (PS3) do this?
I have tried and can't seem to make this work.  It
would be neat if I could get PS3 to work, so it would
display    foobar: root: #.  But at least I have
something.  Here is what I tried 
PS1="`uname -n`: $LOGNAME: "$
PS3="`uname -n`: root: "#
export PS1 PS3

To all that indicated that giving out root access to
users that don't know unix is scary I have to agree. 
The person is the who installs Oracle, and I don't
have a choice in that matter.

++++++++++++++++ Original Question

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

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

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
In both systems I use korn shell and in .profile I
have the following
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

foobar:kange: $su 

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

# pwd

With Solaris 2.8

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

foobar2: kange: $pwd

foobar2: kange: $su     

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

foobar2: kange: $pwd
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
sunmanagers mailing list
Received on Tue Aug 13 13:49:35 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:52 EST