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

jquery - Invalid Assignment Left-Hand Side -

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

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -