I currently have 3 variables which are either set to true or false. I have 5 such scenarios:
var1 = T; var2 = T; var3 = T
var1 = T; var2 = T; var3 = F
var1 = F; var2 = T; var3 = F
var1 = F; var2 = F; var3 = T
var1 = F; var2 = F; var3 = F
I would like to create a loop in my bash script that is able to loop over each of the above 5 scenarios and set the variables accordingly. Is there a way to put everything in a matrix-like array and call them out? If I do:
for var1 in T F; do for var2 in T F; do for var3 in T F; do
# execute whatever here.....
done
done
done
It obviously goes over what I want, and if I were to scale this up to many variables and many scenarios, it becomes unfeasible. In summary, I would like have three variables set for each loop that contains the values in each of the 5 scenarios. Is there a way to program this in a bash script? thanks.