Hi everyone,
I am writing a bash script on RedHat V5.1. In this script i have to run one command using dbAdmin and right after that i have to switch again to root user to run the other commands. Can anybody tell me how i can do this in bash scripting.
Thanks in advance….
You need to run your script as root.Then in any part of code just do this:
Replace command with whatever you want to run under dbadmin user.
This is exact way how redhat init scripts run services under specific users, eg. oracle DB