Bash Convert Variable To Array Javascript Length