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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.