Category
shell
Sub-Category
korn
Description
Today we ran into serious porting problems while trying to get a commercial application (Cyc) moved from Suse Linux 9.2 to Solaris 10.
The kornshell shell interpreter seems to be an obsolete version which no longer understands modern korn shell constructs such as "typeset -A" or some kind of "traps", rendering the application useless on Solaris.
Suse Linux version of ksh is
$ echo ${.sh.version}
Version M 1993-12-28 q
Solaris ksh version cannot be queried ("bad substitution" error).
Is there actually a maintainer for Solaris ksh or is there noone using this shell?
Frequency
Always
Regression
Solaris 10
Steps to Reproduce
Small test script:
#!/bin/ksh
typeset -A x
x[bobby]="a"
x[dog]="b"
echo ${x[bobby]}${x[dog]}
Expected Result
The script should output:
ab
Actual Result
Solaris /bin/ksh generates syntax error, Suse Linux just executes this script w/o problems.
Error Message(s)
"bad substitution"
Test Case
#!/bin/ksh
typeset -A x
x[bobby]="a"
x[dog]="b"
echo ${x[bobby]}${x[dog]}
Workaround
Use Linux
Submitter wants to work on bug
Yes
Additional configuration information
-
Work Around
Use dtksh as *currently* supplied with CDE in /usr/dt/bin/dtksh.
Alternativly download the latest ksh from AT&T, see http://wikipedia.org/wiki/Korn_shell