2 comments

2

https://github.com/koalaman/shellcheck/wiki/SC2045

Shellcheck is an awesome website! Did you try the first suggestion in the above link? Though I personally can't testify to the fragility of iterating over objects...

1

If you read man grep(1) you'll see that your -q option suppresses output. I don't think you want to do that since you're using the output to build an array of values.