Operating System - HP-UX
1837965 Members
2512 Online
110124 Solutions
New Discussion

why this code core dumps?

 
sekar_1
Advisor

why this code core dumps?

Hi,

#############################################
if [ -r /opt/HPOV_IPA/bin/ovta_wls.sh ]; then
. "/opt/HPOV_IPA/bin/ovta_wls.sh"
CLASSPATH="${CLASSPATH}:${OVTA_JAR}"
JAVA_OPTIONS="$JAVA_OPTIONS $OVTA_JAVA_OPTIONS"
echo $CLASSPATH
else
echo "Sorry, /opt/HPOV_IPA/bin/ovta_wls.sh is not readable, please investigate, bye ..."
exit 1
fi
#############################################
can you tell me why this code core dumps and how to avoid?

Thanks.
3 REPLIES 3
V. Nyga
Honored Contributor

Re: why this code core dumps?

Hi,

first tipp - comment out some lines and check if the remaining lines work.
I think here you also need a ':'
JAVA_OPTIONS="$JAVA_OPTIONS:$OVTA_JAVA_OPTIONS"
and maybe also the brackets '{' and '}' ?

HTH
Volkmar

P.S.
Which shell is it?
*** Say 'Thanks' with Kudos ***
sekar_1
Advisor

Re: why this code core dumps?

thanks...i will try that and reply.
Hein van den Heuvel
Honored Contributor

Re: why this code core dumps?

I don't think it is the code shown which causes a core dump, but rather sonething it
runs: /opt/HPOV_IPA/bin/ovta_wls.sh
And in turn that probably does not cause a dump, because shell scripts do not tempt to cause dump. It is probably a program it calls.
Try debug with print statements or use a first line:
set -x

Free advice, if you are going to use a piece of string more than once, then please put it in a variable. Otherwise it is way to easy to create spelling/maintenance errors.
IN the example the string "/opt/HPOV_IPA/bin/ovta_wls.sh" is used 3 times.
Stick it into a variable. Once.
For example:
$ovta_wls_script="/opt/HPOV_IPA/bin/ovta_wls.sh"

Good luck,
Hein.