Operating System - HP-UX
1846541 Members
2163 Online
110256 Solutions
New Discussion

Re: Need help on shell script error.

 
SOLVED
Go to solution
Gulam Mohiuddin
Regular Advisor

Need help on shell script error.

Whenever I try to run the attached script I get the following error:

ref_gulam.sh[204]: post_rman: not found.

Screen Shot:
[/home/ora9i/dbjob/refresh/gulam]$> sh -x ref_gulam.sh
+ INITFILE=/home/ora9i/dbjob/refresh/gulam/dump
+ export INITFILE
+ DIR=/home/ora9i/dbjob/refresh/gulam
+ export DIR
+ ORACLE_SID=aqprod
+ export ORACLE_SID
+ post_rman
ref_gulam.sh[204]: post_rman: not found.

Thanks,

Gulam.
Everyday Learning.
9 REPLIES 9
Aykut Guven
Regular Advisor

Re: Need help on shell script error.

looks like there is no file named post_rman in the path.
UPS
Arunvijai_4
Honored Contributor

Re: Need help on shell script error.

Hi Gulam,

Is post_rman in your path ? Try to export in the PATH variable, and execute it ..

# whereis post_rman

# export PATH=$PATH:

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Sandman!
Honored Contributor

Re: Need help on shell script error.

Hi,

The "post_rman" is a function called from within your script and looks like it's missing a space between the function name and the opening parenthesis i.e.

post_rman() {
cmds
}
OR
post_rman()
{
cmds
}
Tiziano Contorno _
Valued Contributor

Re: Need help on shell script error.

Gulam, should be the space in beetwen () and { of your functions.

Regards.
Gulam Mohiuddin
Regular Advisor

Re: Need help on shell script error.

I added a space between () and {.

But still the same error:
[/home/ora9i/dbjob/refresh/gulam]$> sh ref_gulam.sh
ref_gulam.sh[201]: post_rman: not found.


Thanks,

Gulam.
Everyday Learning.
Sandman!
Honored Contributor
Solution

Re: Need help on shell script error.

Hi,

The function "rman_main" defined right before "post_rman" is missing an EOF character. You started the here document to "rman_main" but forgot to terminate it. Add an EOF on a line by itself, just before the closing brace like:

rman_main() {
rman target / msglog $DIR/rmandb.log << EOF >$DIR/rman.log
...
}
exit;
EOF
}

cheers!
Tiziano Contorno _
Valued Contributor

Re: Need help on shell script error.

Gulam, can you comment the whole rman_main() function definition block and run it again?
I don't get the meaning of the

run {
}

block inside of it.

Regards.
James A. Donovan
Honored Contributor

Re: Need help on shell script error.

Looks like Sandman beat me to it...the missing EOF is the problem...
Remember, wherever you go, there you are...
Gulam Mohiuddin
Regular Advisor

Re: Need help on shell script error.

Thank you very mcuh "Sandman". I got it working.

I grep EOF and showed me 9 instead of 10.

Again thank you very much everybody, I wasted lot of time troubleshooting this script.

You guys saved my lot of time.

Regards,

Gulam.
Everyday Learning.