Capture the original user

in our environment role ids are created in unix to which user does su.
say my individual id is drout and a role is devid.

i will login to drout
the su - devid
password : <nothing > password less role id
then i will login to devid.

can i write a function and pass it in a script while i logged in to devid which will say my original user id drout.

say orig_user_id=function() ..

function() should return my user id and assign to the vvaribale which can be used at different places.

Solaris?

--ahamed

sudo is a great utility for this sort of thing, and it sets SUDO_USER for easy access to previous user ID.

yes sun solaris

in our env we dont use sudo.we have role ids and we use the below command

individual id >

su - roleid
passwod:

roleid >

You could try $LOGNAME if not su to role and then set | grep origuserid (where origuserid is userid you were before) to see if any variables still store the origuserid.