Minecraft wiki entry for Mac_Scripting_Tutorial, associated text: The next part, starting with the "IF" statement, looks at the exit status that Java spits out when it finishes. If Tectonicus runs successfully and reports no errors, then the Java process will send back an exit status of 0 when it's done. The script is watching for an exit status of anything except 0 (that's the "if $? -ne 0" bit—if the exit code is not equal to zero), and if it sees anything except zero, it writes its own error message to the log file and terminates.