If one is running a macro file in batch mode, then a command which is invalid for some reason should cause the simulation to terminate, rather than the command simply being ignored. Presumably, the command was typed in wrongly by the person composing the macro, and not running the proper command will lead to undetermined Monte Carlo results. 81 G4int rc = UImanager->ApplyCommand(commandLine); In my opinion, Geant should throw an exception if rc is nonzero.
Thank you for reporting about this concern. It makes lots of sense to terminate the batch execution if a coomand in the macro file is invalid. On the other hand, issuing an exception and terminating the entire program might not be a desired behavior if the macro file is issued from an interactive session. I modified G4UIbatch so that it now aborts the execution of the problematic macro file (and any other parent macro files which issued this macro file) if a command is invalid. Thus, if the program is purely in the batch mode, the program terminates, while program comes back to the interactive mode if this problematic macro file is issued by an interactive command. This modification should be included in the coming release.