The shell script job entry allows to insert scripts instead of executing a script from a file. This execution is flawed on Windows if the script contains any line feeds (LF) or carriage returns (CR).
This is because the Windows command shell treats a LF/CR as the termination of a command, so the inserted command script only get executed until the first LF/CR, the rest of the script is ignored by the shell. If the execution of the first part was successful then the result of the job entry is true as well even if only part of the script was executed (and the user will never assume that the rest of the script was skipped).
IMHO there are two ways of treating this issue:
- the inserted script could be written into a temporary file which gets executed afterwards (already done if the OS is not Windows)
- the LF/CR in the script could be replace by the characters "&&" to instruct the command line shell to interpret the parts as single commands which get executed sequentially (command1 && command2 means that command2 only gets executed if command1 was executed successfully).
It's quite common to structure scripts using LF/CR so this should be supported properly.