Uploaded image for project: 'Pentaho Data Integration - Kettle'
  1. Pentaho Data Integration - Kettle
  2. PDI-2768

The shell script job entry fails for inserted scripts on Windows if the script contains any line feeds or carriage returns



    • Type: Bug
    • Status: Closed
    • Severity: High
    • Resolution: Fixed
    • Affects Version/s: 3.1.4, 3.2.2
    • Fix Version/s: 3.1.5, 3.2.3, 4.0.0 GA
    • Component/s: Job Entry
    • Labels:
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.


      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.




            rfellows Rob Fellows (Inactive)
            belienig Benjamin Kallmann
            0 Vote for this issue
            0 Start watching this issue