[ILUG] bash: nohup can't see a function

bryan ( admin at revoltingdigits.com) revoltingdigits at gmail.com
Thu Jun 2 11:03:51 IST 2005


he there, trying to hack up a little bash script to shut down and bring back 
up the oracle monitoring and maintenance tools on linux 
( because they crash so often ( 10g is really alpha ... as in quality rather 
than top of the pack ) ) ... anyhow it's a while since i've 
done any bash scripting and it seems there is a slight problem with the 
script. 

The reason I'm running the function asynchronsly is because 

a) The commands take such an incredibly long time to run ( even on a brand 
new server )
b) I would like to run it as a nightly job perhaps.

anyhow the email contains the following .,..... 

/usr/bin/nohup: line 79: exec: restartoraclegui: not found

Perhaps I am trying a completely wrong approach here, i also considered 
using this line 

then ( restartoraclegui | mail admin\@revoltingdigits.com -s "oracle gui 
restart" 2>&1 ) 

Any bashers in here got any ideas ?

Thanks 

Bryan

snip=
#!/bin/sh

restartoraclegui () {

${ORACLE_HOME}/bin/isqlplusctl stop;
${ORACLE_HOME}/bin/emctl stop dbconsole;

${ORACLE_HOME}/bin/isqlplusctl start;
${ORACLE_HOME}/bin/emctl start dbconsole;

}

var=`whoami` ;

if [ "$var" = "oracle" ];

then nohup restartoraclegui | mail admin\@revoltingdigits.com -s "oracle gui 
restart" 2>&1 &

else
echo "you have to be logged on as oracle user to run this script";exit 1;
fi

=snip



More information about the ILUG mailing list