Convert While Loop Into For Loop In Bash