I have this if in a bash script:
if [ $ACTION = deploy ]; then
${JAVA_HOME}/bin/java ${JVM_ARGS} weblogic.WLST << EOJ
connect('XXX','XXX','t3://XXX:8001')
jndi();
ls();
disconnect();
exit ();
EOJ
else
echo "XXX"
fi
I think the error is in the EOJ.
Best Answer
EOJ
needs to be fully left-justified, ie. no leading white-space, and no trailing space either. Also, you could/should (depending on your needs) write the first one as<<'EOJ'
.. the quotes disable some shell expansion which can otherwise occur.From
info bash