How to Use two different users in bash scripting -


hi everyone, writing bash script on redhat v5.1. in script have run 1 command using dbadmin , right after have switch again root user run other commands. can tell me how can in bash scripting.

thanks in advance....

you need run script root.then in part of code this:

su - dbadmin -c "command" 

replace command whatever want run under dbadmin user.

this exact way how redhat init scripts run services under specific users, eg. oracle db


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -