Bash Shell Loop Through Array Javascript Length