Skip to main content

All Questions

0 votes
0 answers
218 views

Unexpected behavior during index assignment in a Bash array [duplicate]

I'm having trouble assigning values to a specific bash index, but apparently only when the index variable is set using a while read loop. Taking this code as a test example: #!/bin/bash read -d '' ...
steinocaro's user avatar
1 vote
2 answers
2k views

Merge duplicate keys in associative array BASH

I've got an array that contains duplicate items, e.g. THE_LIST=( "'item1' 'data1 data2'" "'item1' 'data2 data3'" "'item2' 'data4'" ) Based on the above, I want to create an associative array that ...
Bart's user avatar
  • 2,314