Exit to user from SU in bash script

Is there a way I can initiate a script as root, then exit to my normal admin user (sudoers) to accomplish further tasks as the user? I tried exit but the script stopped completely. Things like RVM like to be installed using the user.
 
You could start a second script from inside the first using su - username -c /path/to/second/script.sh. Or just use su - username -c command to execute the commands inside the script.

Besides that, I don't know.
 
Sounds like a solution. I was surprised to see that it didn't exit to the original initiator of the shell.
 
Back
Top