1825789 Members
2135 Online
109687 Solutions
New Discussion

Shell Script

 
SOLVED
Go to solution
Ricardo_11
Occasional Advisor

Shell Script

Hi guys. What should I use on a shell script in order to execute one command after other?
****
#!/bin/sh
su - appltest
cd /ora/oraprod
dbstop
****
After I became user appltest what should I do to execute the next estep? I??m not able to execute the cd /ora/oraprod. The first step is executed (su - apltest) and nothing more happens.
Thank you in advance.
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: Shell Script

Hi:

# su -user -c command_or_script

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor
Solution

Re: Shell Script

Hi (again):

Sorry, there should be a blank after the hyphen and before the user (account), so it reads:

# su - user -c command_or_script

Regards!

...JRF...
Olivier LEGRAND
Frequent Advisor

Re: Shell Script

Hi,

# su - appltest -c "cd /ora/oraprod;./dbstop"

Hope this helps.

Regards