Hi All,
I am a newbie to shell scripting. I am trying to something like this.
#!bin/bash
cd /u01/app/oracle/
# then start the process
./opmnctl startall
Can someone help me with this requirement.
Help is very much appreciated.
Thanks
Venkat
Hi All,
I am a newbie to shell scripting. I am trying to something like this.
#!bin/bash
cd /u01/app/oracle/
# then start the process
./opmnctl startall
Can someone help me with this requirement.
Help is very much appreciated.
Thanks
Venkat
try
#!bin/bash
# start the process from absolute path
. /u01/app/oracle/opmnctl startall
The shebang needs an absolute file path:
#!/bin/bash
Does /u01/app/oracle/opmnctl exist? What does
ls -l /u01/app/oracle/opmnctl
produce?
--
@makarand Dodmis: that would be sourcing
Hello venkat8439,
Welcome to the forum. It's a request please use the code tage while posting the codes and commands as per forum rules. Now for your script yes you are going good. You need to put the same commands in a file which should have execution permission(or depending on your need like if you allow others to execute or not) and then try to execute it. Also keep shebang on top of the script.
Thanks,
R. Singh
Hi All,
#!/bin/bash
. /u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl status
I am getting this output
[oracle@xxxxxx obiee_scripts]$ ./start_opmnctl1.sh
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 25: =: command not found
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 26: =: command not found
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 28: syntax error near unexpected token `('
Update your PATH variable at the beginning of your script by adding /u01/app/oracle/obiee117g/instances/instance1/bin to it and try again...
e.g.
export PATH=$PATH:$HOME/bin:/u01/app/oracle/obiee117g/instances/instance1/bin
#!/bin/bash
export PATH=$PATH:/u01/app/oracle/obiee117g/instances/instance1/bin
. /u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl status
Is this right ??
If so.. I am getting following message
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 25: =: command not found
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 26: =: command not found
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 28: syntax error near unexpected token `('
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 28: `%commands = ('
Thanks
Venkat
As scrutinizer mentionned in post#3 . ~something is sourcing which means you changed an environment that will affect all your current shell.. Doing that with a program would mean " Replace my (current) shell by program" and at the end of program it exits and you are doomed since you have no shell anymore...
Hi,
I tried
[oracle@xxxxx obiee_scripts]$ ./start_opmnctl1.sh
./start_opmnctl1.sh: line 2: iexport: command not found
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 25: =: command not found
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 26: =: command not found
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 28: syntax error near unexpected token `('
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 28: `%commands =
I am using OEL6
I cant answer for you, since it doesnt look as a standard installation...
Usually you would have all you need in $ORACLE_HOME/opmn/bin/
The suggestion in post #2 is wrong. Following vbe's path approach, you could try:
#!/bin/bash
export PATH=$PATH:/u01/app/oracle/obiee117g/instances/instance1/bin
opmnctl status