I am looping through multiple input files for two programs: bamtofastq-1.3.2 and cellranger count The output from bamtofastq-1.3.2 makes a folder ($FILE.folder) and a subfolder in which the files I need for the cellranger count are stored. I am linking to this folder using wildcard. However, the path to the files are not recognised. Any idea if the wildcards are wrong?
#!/bin/bash
mapfile -s 1 -t files <  files.txt 
echo "${files[@]}"
for FILE in ${files[@]}; do
    bamtofastq-1.3.2 --nthreads 40 $FILE $FILE.folder
    cellranger count --id=sample_$FILE \
    --transcriptome=refdata-gex-GRCh38-2020-A \
    --fastqs=$FILE.folder/*/;
done
files.txt
scRNA_sorted_25183_Relapse_1_bam
scRNA_sorted_27522_Primary_bam
Error:
error: Invalid value for '--fastqs <PATH>...': No such file or directory: 'scRNA_sorted_25183_Relapse_1_bam.folder/*/'
    
scRNA_sorted_25183_Relapse_1_bam.folder. BTW, you better use quotes:for FILE in "${files[@]}"; do, just in case that one day, there are spaces in the file names.${files[@]}, but also for all mentions of$FILE.