So I have this to be entered into and associative array:
47 SPRINGGREEN2
48 SPRINGGREEN1
49 MEDIUMSPRINGGREEN
50 CYAN2
51 CYAN1
52 DARKRED
53 DEEPPINK4
It's part of a bash script. I'm looking for a way to make an associative array out of this, so it would look like
declare -A cols=( [SPRINGGREEN2]="0;47"...[DEEPPINK4]="0;53" )
I can do that quite easily manually.
But I want to use a for loop to populate the array cols=( [KEY]="vALUE" ) For loop will take 47, 48, 49...53 and out it into VALUE field, and SPRINGGREEN2...DEEPPINK4 into the key field.
I was thinking using awk but couldn't figure our how to isolate the two fields and use each entry to populate the array.