Reordered bash loops.