text: user7153: I'm updating my WDL from draft 2 (whichs works fine) to version 1. I'm stuck with a Py snippet
  task getReadGroup {
  
      input {
          String inputFile
      }
  
      command {echo input = ${inputFile}}
  
      # command <<<
      # python <<CODE
      # print ("${inputFile}".strip().split('/'))
      # CODE
      # >>>
  
      output {
      Array[String] o = read_lines(stdout())
      }
  }
  
  This command gives the expected result:
  input = /mnt/lustre/working/genomeinfo/data/20191015_LongRead/20191015_LongRead_1/data/LXBAB201271/LXBAB201271/LXBAB201271/20190417_0612_1-A7-D7_PAD44174_42dcde1a/fast5/test/
  
  But the commented out python code:
  print ("${inputFile}".strip().split('/'))
  
  Gives an empty list - "${inputFile}" is empty in the code command for some reason!
  Any ideas? I've tried using a File instead of String to make it just like the example in the docs (below) other than that I see no diff:
  task heredoc {
    input {
      File in
    }
  
    command<<<
    python <<CODE
      with open("${in}") as fp:
        for line in fp:
          if not line.startswith('#'):
            print(line.strip())
    CODE
    >>>
  }
  
  
  user7153: Complements of Phil Shapiro;
  Use ~{} instead of ${}.
  So this example from the current docs is wrong:
  task heredoc {
    input {
      File in
    }
  
    command<<<
    python <<CODE
      with open("${in}") as fp:
        for line in fp:
          if not line.startswith('#'):
            print(line.strip())
    CODE
    >>>
  }
  
  It should be :
  task heredoc {
    input {
      File in
    }
  
    command<<<
    python <<CODE
      with open("~{in}") as fp:
        for line in fp:
          if not line.startswith('#'):
            print(line.strip())
    CODE
    >>>
  }
  
  
original_text: 7153: <p>I'm updating my WDL from draft 2 (whichs works fine) to version 1. I'm stuck with a Py snippet</p>
  <pre><code>task getReadGroup {
  
      input {
          String inputFile
      }
  
      command {echo input = ${inputFile}}
  
      # command &lt;&lt;&lt;
      # python &lt;&lt;CODE
      # print (&quot;${inputFile}&quot;.strip().split('/'))
      # CODE
      # &gt;&gt;&gt;
  
      output {
      Array[String] o = read_lines(stdout())
      }
  }
  </code></pre>
  <p>This command gives the expected result:</p>
  <pre><code>input = /mnt/lustre/working/genomeinfo/data/20191015_LongRead/20191015_LongRead_1/data/LXBAB201271/LXBAB201271/LXBAB201271/20190417_0612_1-A7-D7_PAD44174_42dcde1a/fast5/test/
  </code></pre>
  <p>But the commented out python code:</p>
  <pre><code>print (&quot;${inputFile}&quot;.strip().split('/'))
  </code></pre>
  <p>Gives an empty list - &quot;${inputFile}&quot; is empty in the code command for some reason!</p>
  <p>Any ideas? I've tried using a File instead of String to make it just like the example in the docs (below) other than that I see no diff:</p>
  <pre><code>task heredoc {
    input {
      File in
    }
  
    command&lt;&lt;&lt;
    python &lt;&lt;CODE
      with open(&quot;${in}&quot;) as fp:
        for line in fp:
          if not line.startswith('#'):
            print(line.strip())
    CODE
    &gt;&gt;&gt;
  }
  </code></pre>
   7153: <p>Complements of Phil Shapiro;</p>
  <p>Use ~{} instead of ${}.</p>
  <p>So this example from the current docs is wrong:</p>
  <pre><code>task heredoc {
    input {
      File in
    }
  
    command&lt;&lt;&lt;
    python &lt;&lt;CODE
      with open(&quot;${in}&quot;) as fp:
        for line in fp:
          if not line.startswith('#'):
            print(line.strip())
    CODE
    &gt;&gt;&gt;
  }
  </code></pre>
  <p>It should be :</p>
  <pre><code>task heredoc {
    input {
      File in
    }
  
    command&lt;&lt;&lt;
    python &lt;&lt;CODE
      with open(&quot;~{in}&quot;) as fp:
        for line in fp:
          if not line.startswith('#'):
            print(line.strip())
    CODE
    &gt;&gt;&gt;
  }
  </code></pre>
  