More compatible loop with old bash versions.