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.

How can I include {} in a WDL script?

I am trying to do "ls {fastq,fq} | wc -l" in a WDL command. I am getting an error about "unrecognized token" which I think has to do with the fact that I am including {} in the WDL that are not meant for expansion (but I could be wrong about the error message meaning).

A few lines of the actual WDL are here:

  command {

    set -x

    for i in ${sep=' ' fastqTar}; do tar -xvzf $i; done
    export COUNT=`ls *{fastq,fq}* | wc -l`
    if [ $COUNT \> 1 ];

Best Answer

  • KateNKateN Cambridge, MA admin
    Accepted Answer

    It is true that the use of {} can confuse the execution engine. When you need to use curly braces within your command block, you can use the following syntax instead:

    command <<<
        set -x
    
        for i in ${sep=' ' fastqTar}; do tar -xvzf $i; done
        export COUNT=`ls *{fastq,fq}* | wc -l`
        if [ $COUNT \> 1 ];
    >>>
    

Answers

  • KateNKateN Cambridge, MAMember, Broadie, Moderator admin
    Accepted Answer

    It is true that the use of {} can confuse the execution engine. When you need to use curly braces within your command block, you can use the following syntax instead:

    command <<<
        set -x
    
        for i in ${sep=' ' fastqTar}; do tar -xvzf $i; done
        export COUNT=`ls *{fastq,fq}* | wc -l`
        if [ $COUNT \> 1 ];
    >>>
    
Sign In or Register to comment.