I crawled through lots of boards but didn't find the final solution for my problem.

I have got an array, named "array0", the name is stored to a variable called `arrayname`. Also I've got a logged IP address, let's say 127.0.0.1, also stored in a variable, called ip.

Now I want to assign the IP to index 3 in the array like that: 

```
"$arrayname"[3]="$ip"    

```

So, this didn't work. I tried lots of ways how to solve that but none worked.  

Is anyone out there who can tell me the final solution for this case?

**Update:** The given opportunities to handle the problem are great! But I forgot to mention that the array I'm working with is just sourced from another file (also written in bash). My goal is now to edit the array in the sourced file itself. Any more ideas for that?