Bash Variable To Array Javascript Length Validation