Skip to content

cwltool mishandles line continuations in bash scripts #1271

Open
@ghost

Description

cwltool --version
/Users/kghose/.venvs/toil/bin/cwltool 3.0.20200324120055

The following bash script is valid

set -xv

echo \
  "A new line" \
  "Another line" \
  "Boo"

The following CWL with an embedded bash script is not correctly handled by cwltool. It looks like the line continuation \ symbol is removed?

class: CommandLineTool
cwlVersion: v1.0
requirements:
  DockerRequirement:
    dockerPull: sevenbridges/svsim:1.0
  InitialWorkDirRequirement:
    listing:
      - entryname: script.sh
        entry: |          
          set -xv

          echo \
            "A new line" \
            "Another line" \
            "$(inputs.foo)"

baseCommand: ["bash", "script.sh"]

inputs:
  foo: string

outputs:
  out: stdout

stdout: out.txt

The cwltool (and also toil, since toil uses cwltool) error is:

echo
+ echo
  "A new line"
+ 'A new line'
script.sh: line 4: A new line: command not found
  "Another line"
+ 'Another line'
script.sh: line 5: Another line: command not found
  "Hello"
+ Hello
script.sh: line 6: Hello: command not found
INFO [job test.cwl] Max memory used: 0MiB
WARNING [job test.cwl] completed permanentFail

As a contrast the SB platform executor executes this correctly.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions