Change to bash C-style for loop