Tag: associative array

  • bash version 4 and associative arrays

    The new builtin array variable BASH_ALIASES is a nice example for an associative array. If you do an ”echo ${BASH_ALIASES[@]}” you see all the values, if you do a “set | fgrep BASH_ALIASES” you see, to what the indexes map. Update: In December, when I got aware of the new feature, I thought, there is…

  • using associative arrays in your code

    How many lines of code does it take for your new piece of code, before you introduce an associative array? How many lines of code does it take for your new piece of code, before you introduce a class? Yes, I know, Bourne shell doesn’t come with the concept of associative arrays, of course it…