Return value from a Java code
问题 There is a Java class which creates a POST request and sends it to a servlet. The main method of the class file (test) looks something like this: public static void main(String[] args) throws IOException { // Code logic goes here... // No return Statement } This is called from a KornShell (ksh) script something like this: retcode=`$CLK_JAVA_PATH -cp $CLASSPATH test ${PASSWORD} ${HOSTNAME} ${TOOLSET}` if [ $? != "0" ];then echo "ERROR: echo "${retcode}" else echo "${SCRIPT} Success" fi retcode