I have a bash command built from an array as following:
cmd=(java -Xmx8g -jar program.jar input.vcf ">" output.vcf) I do not have problems when using echo:
echo "${cmd[@]}" java -Xmx8g -jar program.jar input.vcf > output.vcf But when I run it using:
"${cmd[@]}" The > is ignored and I cannot redirect stdout to output.vcf file.
Please, could you suggest me a solution?
>isn't ignored; instead, it's passed to the Java program as an argument.eval "${cmd[@]}".