I have a series of input files I want to run using a bash script. These are identified using a file location (the same for all files) and an individual file suffix made up of the name of the type of input and the temperature. I want my script to loop over name, then temperature, in order to run the files in this order:
file_location_a_300
file_location_a_290
file_location_a_281
file_location_a_270
file_location_b_300...
And so on and so forth.
This is what I have so far. My issue at present is that the $i name caller in INPUT and OUTPUT isn't working. I get the error "Failed to open input file "file_location_300". The echo line works fine and outputs both the name and the temperature. I don't understand why the name is being omitted in the input and output file caller line?
#!/bin/bash
temps=(300 290 281 270)
names=(a b c)
for i in "${names[@]}";
do
for j in "${temps[@]}";
do
[FILE EXECUTABLE INFORMATION]
INPUT=file_location_$i_$j OUTPUT=../out/file_location_$i_$j.out
echo $i $j
done
done