/tmp/yyy: line 7: vars: [red]=rose: must use subscript when assigning associative array /tmp/yyy: line 7: vars: [green]=grass: must use subscript when assigning associative array /tmp/yyy: line 7: vars: [blue]=sky: must use subscript when assigning associative array declare -A vars='([yellow]="submarine" [white]="snow" [black]="night" [pink]="elephant" )'
/tmp/yyy: line 7: vars: [red]=rose: must use subscript when assigning associative array /tmp/yyy: line 7: vars: [green]=grass: must use subscript when assigning associative array /tmp/yyy: line 7: vars: [blue]=sky: must use subscript when assigning associative array declare -A vars='([yellow]="submarine" [white]="snow" [black]="night" [pink]="elephant" )'
1) Why does the cat not work? What is it REALLY complaining about, as the individual lines are formatted properly.
2) Since IFS is set to just the newline character, I was surprised to see that [black] does not equal 'night [white]=snow' . It is still breaking things up on the space.
3) In the second execution of func, the last line of the file does not contain a newline and yet its able to locate the [yellow]= and isolate it from whatever it doesn't like on the last line of the cat. The IFS appears to be ignored in locating the keys. Are keys located first and then whatever is between keys is the value?