Does pdksh (public domain kornShell) support associative arrays?

I recently ran into a wall doing some bash shell programming where an associative array would solve my problems. I searched for KornShell (ksh) capabilities and found out it supports associative arrays, so I installed Cygwin pdksh (Public Domain KornShell).

However, when trying to create an associative array in the specified order (typeset -A varName), I got the following errors, so I am starting to suspect that pdksh does not support associative arrays.

./find_actions.ksh: line 2: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...

      

Suppose I would consider Perl instead, but I really wanted to find a good excuse to learn a dialect / language new to me.

0


source to share


3 answers


Take a look at ksh93, it supports associative arrays and is a much more complete / correct implementation of ksh.



See: kornshell.com

+1


source


pdksh does not support associative arrays; its a planned and specific feature of its successor, μx (as soon as I get around to implementing it, that is ... sorry for taking his time with it).



+1


source


Why not just use bash? It may not have explicit associative arrays, but you can fake them .

Alternatively, zsh has excellent associative array support .

0


source







All Articles