I'm relatively new with bash (programming in general) and have been self taught for the most part, but I have a while loop that is only supposed to exit if ALL the conditions are met.
while [[ "$var1" != "$var1_tgt" ]] && [[ "var2" != "$var2_tgt" ]] && [[ "$var3" != "$var3_tgt" ]] && [[ "$var4" != "$var4_tgt" ]]; do LOOP...; done
The problem I seem to be having (I think) is in the evaluation of the loop. When I run the script it will break if only one of the conditions is met, but I want the loop to break only when ALL conditions have been satisfied. That is, when the var# equals the var#_tgt for ALL var's, only then should the loop break. As far as I know using "&&" should mean that all conditions must be met before the loop will exit, but the fact that it's not working means I am missing something. I appreciate any help figuring this out.
$var2_tgtmatching$var, and$var2_tgtmatching$var2, then as you progress through the loop one or more of the variables will be changed so they no longer match the target. And if they fail to match, you break out of the loop. Have I got that right? If so, can you provide us with example code that sets variables so we can test how things run?