I have a script to prepare some files to submit trough qsub to a cluster, I am creating an array based on a file and then using the elements in that array to create my qsub files.
However, I can't append the variables to the $RawData/$i_1.fastq.gz part. This is my script:
> cat create.sh
#!/bin/bash
RawData="/home/jfertaj/data/FASTQ"
# make an array of each sample id
mapfile -t myArray < array.txt
for i in "${myArray[@]}"
do
cat > pbs.script.$i << EOF
#!/bin/bash
kallisto quant -t 16 -b 100 -o /home/jfertaj/data/results_kallisto/output_bootstrap_$i $RawData/$i_1.fastq.gz $RawData/$i_2.fastq.gz
EOF
done
exit 0;
when I run the bash script and look the created files I see this:
...
kallisto quant -t 16 -b 100 -o /home/jfertaj/data/results_kallisto/output_bootstrap_INTP_993 /home/jfertaj/data/FASTQ/.fastq.gz /home/jfertaj/data/FASTQ/.fastq.gz
I have tried including "$i" but then this shows up on the resulting files: "INTP_993"_1.fastq.tz. Is there any way to fix it?