Switch environments on a single unix server

Hi All,

I have written a script for a particular user say tren212 ,which checks the disk space of the user.
I wish to check the disk space of another user say tren213 in the same script.

How can I do the same?

I have tried using su command but it asks for the password at the time of execution of the script and exits from the script once the password is given.

Can anyone guide me here??

Thanks

Try using sudo

or try using ssh with public/private keys assigned to tren213 and others as needed.

Hi,

I am new to this sudo and things.

Can you please guide me how to implement this logic in my script?

Thanks

Hi ,

I tried using sudo but I am not authorised to use it.

Is there any other workaround fro my problem??

Please advice.

Any help may be very fruitful for me..

Thanks