4

in BASH you cannot reassign associative arrays (i.e. string:string maps) to other variables.

If you have created an array as variable "arr", doing
```
declare -A arr2
arr2=${arr}
```
will not give you var2 as a usable assoc array. It will kind of transform it into an indexed array

In fact working with assoc arrays in shell is a bitch.

Comments
  • 4
    I've never understood why people like bash scripting so much. The language is objectively terrible.
  • 1
    Bash as a whole is a weird quirk
  • 3
    @Root maybe because shell is practicaly everywhere already preinstalled? No need to dig through installers, no need to download anything,.. It's right there on all the machines already.

    That and the fact that it's so limited that it makes you scratch your head how to implement your algo. But it's also so powerful that when I'm back to programming languages I miss bash's features. I think I miss variable expansions the most.

    It tickles my wits

    That's why I love it so much. Can't speak for everyone
Add Comment