Bash Loop Through Array Javascript Append Function In Java