如何在 CWL 文件中放入两个 bash 命令?

How to put two bash commands in CWL file?

我是 CWL 工具的新手。我可以在 basecommand 中使用任何 bash 命令,即:

basecommand cat

basecommand [wc, -w]

我应该如何修改它以使其与

一样
cat | wc -w

会做吗?

应该使用参数和 InlineJavascriptRequirement 来指定参数中的输入:

baseCommand: cat

arguments:
  - $(inputs.infile)
  - "|"
  - wc
  - w

你也可以在cwl中写一个bash脚本和运行脚本。我的意思是:

basecommand: sh 
inputfile: script.sh

该脚本可以包含您的所有命令,例如 cat 和 wc。该脚本还可以为您的命令获取其他输入,例如文件或字符串,您可以在脚本中通过 $1 和 $2 使用它们,然后继续,其中 $1 与第一个参数相关。