The ksh (there's more than one) in this case is the old Solaris ksh88
as *(/usr)/bin/ksh
, which was the default ksh
until (and including) Solaris 10.
AT&T open-sourced ksh93
back in 2002 or so, which was adopted later into linux and various OpenSolaris derivatives.
ksh93
and bash are quite close, and their developers have kept in touch and contributed to the POSIX shell standardisation effort.
The array assignment x=( ... )
is supported in both ksh93 and bash, not in ksh88
, where it results in the above syntax error.
how to solve this problem in ksh88 -- @logan
In ksh88 you can try:
set -A x $(echo $x1 | cut -f3 -d" " | cut -f1 -d"]")
Finally, there have been alternative implementations like mksh and the commercial MKS. I think the latter may actually share some code with the originals ksh88 from the AT&T Toolchest in the '80s. The MirBSD Korn shell, or mksh
is the successor of the abandoned pdksh
project.