Update: July 26, 2019
This section of the forum is no longer actively monitored. We are working on a support migration plan that we will share here shortly. Apologies for this inconvenience.

Using variables that are result of unix commands

Hi! I have a task where I am naming the file according to the first line in the file i.e. the result of the command "head -1 FILENAME". I successfully passed it to my command line, but I cannot grab the file with the output:

task suppa_psi {

  File gtf
  File abund

  command {
    suppa.py psiPerIsoform -g ${gtf} -e ${abund} -o $(head -1 ${abund})

  output {
    File psi_file = "$(head -1 ${abund})_isoform.psi"

  runtime {

The output filename is interpreted literally, which I suppose happens because there is no shell to perform the expression.
I also tried creating a new variable in the definitions "String name = head -1 ${abund}" or "String name = $(head -1 ${abund})" and neither was parsed properly.
How can I grab this file?

Sign In or Register to comment.