Bash Read String Into Array Javascript Function