when I try to create arrays in my script I get errors.
id[1]=string2; would generate error id[1]=string2: not found
I’m guessing it has something to do with the fact that im in a if statement or while loop since the use []? I’m running a VM so attached is a pic of the script thus far the array at top a[1]=string; generates no errors but the one in the logic id[1]=string2; does.

Posting as an answer so this question can be marked as resolved:
Your script is being executed by
sh, notbash. Add a correct shebang line as the first line of the script file: