2

I'm new to CWL tools. I can use any of bash commands in basecommand, i.e.:

basecommand cat

or

basecommand [wc, -w]

How should I modify it to make it do the same as

cat | wc -w

will do?

kainis
  • 21
  • 2
  • You are aware that this is a [useless use of `cat`](https://stackoverflow.com/questions/11710552/useless-use-of-cat)? – tripleee Dec 19 '17 at 08:25

2 Answers2

-1

One should use arguments and InlineJavascriptRequirement to specify input in arguments:

baseCommand: cat

arguments:
  - $(inputs.infile)
  - "|"
  - wc
  - w
kainis
  • 21
  • 2
-1

You can also write a bash script and run the script in the cwl. I mean:

basecommand: sh 
inputfile: script.sh

the script could contain all of your commands such as cat and wc. The script also could get other inputs for your commands such as file or strings too and you can use them inside the script by $1 and $2 and go on in which $1 relate to the first argument.

shadi
  • 46
  • 1
  • 7