Update: July 26, 2019
This section of the forum is now closed; we are working on a new support model for WDL that we will share here shortly. For Cromwell-specific issues, see the Cromwell docs and post questions on Github.

Use complex bash inside cromwell?

I'm trying to use bash arrays inside a command block, but I think this confuses womtool because the validation failes. Did I make some mistake I'm overlooking or is this a known limitation of wdl?

(As background: I'm trying to make an htmlOverview task that uses iframes to put multiple html files inside a single page to make it easier to view html results)

$ womtool validate shared.wdl 
Unrecognized token on line 80, column 23:

        for ((i=0;i<${#files[@]};++i)); do
task htmlOverview {
    Array[File] htmlFiles
    Array[String] samplenames
    String name

    String image

    command {
        set -e

        files=( ${sep=" " htmlFiles} )
        names=( ${sep=" " samplenames} )
        # Print the iframes
        for ((i=0;i<${#files[@]};++i)); do
            local=`basename "${files[i]}"`
            cp "$i" "$filename"
            echo "<h2>${names[i]}</h2>"
            echo "<iframe id="myFrame" src=\"$filename\" style=width:100%;height:100%></iframe>"
        done > "${name}_overview.html"

    runtime {
        docker: "${image}"

    output {
        File overview = "${name}_overview.html"
        Array[File] subplots = glob("*.html")
Sign In or Register to comment.