Bash Shell Loop Through Array Javascript Duplicates In Sql