shell chdir not working

I expected the following to init a git repository in /home/youruser/a, but instead it’s created created in /

what am I doing wrong?

It’s iterating over your list of items correctly, but by indexing to [0], it’s taking the first char of the item, which happens to be ‘/’. Remove the [0] and you should be fine.

Of course, thanks!