Help, with subshell I think? :S
Hi,
I am trying to create a shell script that will ask the user for the "oracle" username and password for the database then execute a sql command exit and return back to the root user and do other commands.
I was thinking of something like a subshell script but I dont know how to go about it.
My method on going at it would be
1) As "root", ask for user/pass (oracle database user/pass)
2) Then log automatically as "oracle" (linux user) and run command "sqlplus"
3) When the sqlplus prompt comes up for username it grabs the input from before and puts it into that line and does so with the password afterwards.
4) Runs sql commands then exits out of oracle database.
5) exits out of "oracle" (linux user) and goes back to root and performs any other commands I want it to.
Hopefully, this is enough information. If you need more I am happy to tell you what I exactly need.
Thanks for reading my thread.
~DjRakso
|