I am trying to submit various pbs files to the HPC using this script. However, I am getting an error in my for loop that I am not able to fix.
I am trying to count the number of files that meet the criteria for submission and then loop through and submit them all.
for i in {1..3}; do
cd "${i}"
files=(*_R$r_*.pbs)
fnum=${#files[@]}
for k in {1.."$fnum"}; do
subm=`echo ${files[$k]}`
qsub "$subm"
done;
cd ..
done;
The error i receive is {1..9}: syntax error: operand expected (error token is "{1..3}") fnum is counting the number of files correctly but then the loop doesnt run