How to run script of another user from root?
Hi,
I am trying to write a script in root which will first login to another user and will execute commands in that session and then will exit.
like,
root > vi test.sh
--in test.sh
su - user2
ls
now from root
root > sh test.sh
it is logging to user2 but not running ls but when I exit from oracle it is running ls. My requirement is that it should execute commands in the new user session.
I am using RHEL AS 4
Please guide.
Thanks
|