1*4887Schin 2*4887Schin KSH-93 VS. KSH-88 3*4887Schin 4*4887Schin 5*4887SchinThe following is a list of known incompatibilities between ksh-93 and ksh-88. 6*4887SchinI have not include cases that are clearly bugs in ksh-88. I also have 7*4887Schinomitted features that are completely upward compatible. 8*4887Schin 9*4887Schin1. Functions, defined with name() with ksh-93 are compatible with 10*4887Schin the POSIX standard, not with ksh-88. No local variables are 11*4887Schin permitted, and there is no separate scope. Functions defined 12*4887Schin with the function name syntax, maintain compatibility. 13*4887Schin This also affects function traces. 14*4887Schin 15*4887Schin2. ! is now a reserved word. As a result, any command by that 16*4887Schin name will no longer work with ksh-93. 17*4887Schin 18*4887Schin3. The -x attribute of alias and typeset -f is no longer 19*4887Schin effective and the ENV file is only read for interactive 20*4887Schin shells. You need to use FPATH to make function definitions 21*4887Schin visible to scripts. 22*4887Schin 23*4887Schin4. A built-in command named command has been added which is 24*4887Schin always found before the PATH search. Any script which uses 25*4887Schin this name as the name of a command (or function) will not 26*4887Schin be compatible. 27*4887Schin 28*4887Schin5. The output format for some built-ins has changed. In particular 29*4887Schin the output format for set, typeset and alias now have single 30*4887Schin quotes around values that have special characters. The output 31*4887Schin for trap without arguments has a format that can be used as input. 32*4887Schin 33*4887Schin6. With ksh-88, a dollar sign ($') followed by a single quote was 34*4887Schin interpreted literally. Now it is an ANSI-C string. You 35*4887Schin must quote the dollar sign to get the previous behavior. 36*4887Schin Also, a $ in front of a " indicates that the string needs 37*4887Schin to be translated for locales other than C or POSIX. The $ 38*4887Schin is ignored in the C and POSIX locale. 39*4887Schin 40*4887Schin7. With ksh-88, tilde expansion did not take place inside ${...}. 41*4887Schin with ksh-93, ${foo-~} will cause tilde expansion if foo is 42*4887Schin not set. You need to escape the ~ for the previous behavior. 43*4887Schin 44*4887Schin8. Some changes in the tokenizing rules where made that might 45*4887Schin cause some scripts with previously ambiguous use of quoting 46*4887Schin to produce syntax errors. 47*4887Schin 48*4887Schin9. Programs that rely on specific exit values for the shell, 49*4887Schin (rather than 0 or non-zero) may not be compatible. The 50*4887Schin exit status for many shell failures has been changed. 51*4887Schin 52*4887Schin10. Built-ins in ksh-88 were always executed before looking for 53*4887Schin the command in the PATH variable. This is no longer true. 54*4887Schin Thus, with ksh-93, if you have the current directory first 55*4887Schin in your PATH, and you have a program named test in your 56*4887Schin directory, it will be executed when you type test; the 57*4887Schin built-in version will be run at the point /bin is found 58*4887Schin in your PATH. 59*4887Schin 60*4887Schin11. Some undocumented combinations of argument passing to ksh 61*4887Schin builtins no longer works since ksh-93 is getopts conforming 62*4887Schin with respect to its built-ins. For example, typeset -8i 63*4887Schin previously would work as a synonym for typeset -i8. 64*4887Schin 65*4887Schin12. Command substitution and arithmetic expansion are now performed 66*4887Schin on PS1, PS3, and ENV when they are expanded. Thus, ` and $( 67*4887Schin as part of the value of these variables must be preceded by a \ 68*4887Schin to preserve their previous behavior. 69*4887Schin 70*4887Schin13. The ERRNO variable has been dropped. 71*4887Schin 72*4887Schin14. If the file name following a redirection symbol contain pattern 73*4887Schin characters they will only be expanded for interactive shells. 74*4887Schin 75*4887Schin15. The arguments to a dot script will be restored when it completes. 76*4887Schin 77*4887Schin16. The list of tracked aliases is not displayed with alias unless 78*4887Schin the -t option is specified. 79*4887Schin 80*4887Schin17. The POSIX standard requires that test "$arg" have exit status 81*4887Schin of 0, if and only if $arg is null. However, since this breaks 82*4887Schin programs that use test -t, ksh93 treats an explicit test -t 83*4887Schin as if the user had entered test -t 1. 84*4887Schin 85*4887Schin18. The ^T directive of emacs mode has been changed to work the 86*4887Schin way it does in gnu-emacs. 87*4887Schin 88*4887Schin19. ksh-88 allowed unbalanced parenthes within ${name op val} whereas 89*4887Schin ksh-93 does not. Thus, ${foo-(} needs to be written as ${foo-\(} 90*4887Schin which works with both versions. 91*4887Schin 92*4887Schin20. kill -l in ksh-93 lists only the signal names, not their numerical 93*4887Schin values. 94*4887Schin 95*4887Schin21. Local variables defined by typeset are statically scoped in 96*4887Schin ksh93. In ksh88 they were dynamically scoped although this 97*4887Schin behavior was never documented. 98*4887Schin 99*4887Schin22. The value of the variable given to getopts is set to ? when 100*4887Schin the end-of-options is reached to conform to the POSIX standard. 101*4887Schin 102*4887Schin23. Since the POSIX standard requires that octal constants be 103*4887Schin recongnized, doing arithmetic on typeset -Z variables can 104*4887Schin yield different results that with ksh88. Most of these 105*4887Schin differences were eliminated in ksh93o. 106*4887Schin 107*4887Schin24. Starting after ksh93l, If you run ksh name, where name does 108*4887Schin not contain a /, the current directory will be searched 109*4887Schin before doing a path search on name as required by the POSIX 110*4887Schin shell standard. 111*4887Schin 112*4887Schin25. In ksh93, cd - will output the directory that it changes 113*4887Schin to on standard output as required by X/Open. With ksh88, 114*4887Schin this only happened for interactive shells. 115*4887Schin 116*4887Schin26. As an undocumented feature of ksh-88, a leading 0 to an 117*4887Schin assignment of an integer variable caused that variable 118*4887Schin to be treated as unsigned. This behavior was removed 119*4887Schin starting in ksh93p. 120*4887Schin 121*4887Schin27. The getopts builtin in ksh93 requires that optstring contain 122*4887Schin a leading + to allow options to begin with a +. 123*4887Schin 124*4887Schin28. In emacs/gmacs mode, control-v will not display the version when 125*4887Schin the stty lnext character is set to control-v or is unset. 126*4887Schin The sequence escape control-v will display the shell version. 127*4887Schin 128*4887SchinI am interested in expanding this list so please let me know if you 129*4887Schinuncover any others. 130