0
#Note: If you see # in front of any line it means that it’s a comment line not the actual code
#** ********************************************************************
FILE_NAME=filename_4.zip
FILE_LOCATION=/home/testvis/generic
ENTITY_LIST=ALL

if ${JAVACMD} -classpath $CLASSPATH:$LIB oracle.ucm.idcws.client.UploadTool \
--url=https://URL_XX/idcws/GenericSoapPort  \
then
echo “File Successfully Uploaded”
else
echo “Exception Uploaded ”
exit 0
fi

This is returning the echo section correctly. But i want the error message which we get in the exception also should be echoed.

Like in PLSQL we have SQLERRM. Do we have a similar variable or any method in shell script ?

1 Answer 1

1

You can use stderr redirection :

command-name 2> stderr.txt

or redirect all of the output like this :

command1 > everything.txt 2>&1

Example:

if ${JAVACMD} -classpath $CLASSPATH:$LIB oracle.ucm.idcws.client.UploadTool \
--url=https://URL_XX/idcws/GenericSoapPort  \
then
echo “File Successfully Uploaded”
else
echo “Exception Uploaded ”
echo $($COMMAND> everything.txt 2>&1)
exit 0
fi
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.