It’s been a while since I’ve done intense bash scripting and I forgot the syntax for doing multiple conditions in a for loop.
In C, I’d do:
for(var i=0,j=0; i<arrayOne.length && j<arrayTwo.length; i++,j++){
// Do stuff
}
I’ve been googling for a while and have only found syntax involving nested for loops, not multiple conditions to one for loop.
Sounds like you’re talking about the arithmetic for loop.
Which assuming
iandjare either unset or zero is approximately equivalent to:and slightly more portable so long as you don’t care about the values of
i/jafter the loop.