1N/A
1N/A KSH-93 VS. KSH-88
1N/A
1N/A
1N/AThe following is a list of known incompatibilities between ksh-93 and ksh-88.
1N/AI have not include cases that are clearly bugs in ksh-88. I also have
1N/Aomitted features that are completely upward compatible.
1N/A
1N/A1. Functions, defined with name() with ksh-93 are compatible with
1N/A the POSIX standard, not with ksh-88. No local variables are
1N/A permitted, and there is no separate scope. Functions defined
1N/A with the function name syntax, maintain compatibility.
1N/A This also affects function traces.
1N/A
1N/A2. ! is now a reserved word. As a result, any command by that
1N/A name will no longer work with ksh-93.
1N/A
1N/A3. The -x attribute of alias and typeset -f is no longer
1N/A effective and the ENV file is only read for interactive
1N/A shells. You need to use FPATH to make function definitions
1N/A visible to scripts.
1N/A
1N/A4. A built-in command named command has been added which is
1N/A always found before the PATH search. Any script which uses
1N/A this name as the name of a command (or function) will not
1N/A be compatible.
1N/A
1N/A5. The output format for some built-ins has changed. In particular
1N/A the output format for set, typeset and alias now have single
1N/A quotes around values that have special characters. The output
1N/A for trap without arguments has a format that can be used as input.
1N/A
1N/A6. With ksh-88, a dollar sign ($') followed by a single quote was
1N/A interpreted literally. Now it is an ANSI-C string. You
1N/A must quote the dollar sign to get the previous behavior.
1N/A Also, a $ in front of a " indicates that the string needs
1N/A to be translated for locales other than C or POSIX. The $
1N/A is ignored in the C and POSIX locale.
1N/A
1N/A7. With ksh-88, tilde expansion did not take place inside ${...}.
1N/A with ksh-93, ${foo-~} will cause tilde expansion if foo is
1N/A not set. You need to escape the ~ for the previous behavior.
1N/A
1N/A8. Some changes in the tokenizing rules where made that might
1N/A cause some scripts with previously ambiguous use of quoting
1N/A to produce syntax errors.
1N/A
1N/A9. Programs that rely on specific exit values for the shell,
1N/A (rather than 0 or non-zero) may not be compatible. The
1N/A exit status for many shell failures has been changed.
1N/A
1N/A10. Built-ins in ksh-88 were always executed before looking for
1N/A the command in the PATH variable. This is no longer true.
1N/A Thus, with ksh-93, if you have the current directory first
1N/A in your PATH, and you have a program named test in your
1N/A directory, it will be executed when you type test; the
1N/A built-in version will be run at the point /bin is found
1N/A in your PATH.
1N/A
1N/A11. Some undocumented combinations of argument passing to ksh
1N/A builtins no longer works since ksh-93 is getopts conforming
1N/A with respect to its built-ins. For example, typeset -8i
1N/A previously would work as a synonym for typeset -i8.
1N/A
1N/A12. Command substitution and arithmetic expansion are now performed
1N/A on PS1, PS3, and ENV when they are expanded. Thus, ` and $(
1N/A as part of the value of these variables must be preceded by a \
1N/A to preserve their previous behavior.
1N/A
1N/A13. The ERRNO variable has been dropped.
1N/A
1N/A14. If the file name following a redirection symbol contain pattern
1N/A characters they will only be expanded for interactive shells.
1N/A
1N/A15. The arguments to a dot script will be restored when it completes.
1N/A
1N/A16. The list of tracked aliases is not displayed with alias unless
1N/A the -t option is specified.
1N/A
1N/A17. The POSIX standard requires that test "$arg" have exit status
1N/A of 0, if and only if $arg is null. However, since this breaks
1N/A programs that use test -t, ksh93 treats an explicit test -t
1N/A as if the user had entered test -t 1.
1N/A
1N/A18. The ^T directive of emacs mode has been changed to work the
1N/A way it does in gnu-emacs.
1N/A
1N/A19. ksh-88 allowed unbalanced parenthes within ${name op val} whereas
1N/A ksh-93 does not. Thus, ${foo-(} needs to be written as ${foo-\(}
1N/A which works with both versions.
1N/A
1N/A20. kill -l in ksh-93 lists only the signal names, not their numerical
1N/A values.
1N/A
1N/A21. Local variables defined by typeset are statically scoped in
1N/A ksh93. In ksh88 they were dynamically scoped although this
1N/A behavior was never documented.
1N/A
1N/A22. The value of the variable given to getopts is set to ? when
1N/A the end-of-options is reached to conform to the POSIX standard.
1N/A
1N/A23. Since the POSIX standard requires that octal constants be
1N/A recongnized, doing arithmetic on typeset -Z variables can
1N/A yield different results that with ksh88. Most of these
1N/A differences were eliminated in ksh93o.
1N/A
1N/A24. Starting after ksh93l, If you run ksh name, where name does
1N/A not contain a /, the current directory will be searched
1N/A before doing a path search on name as required by the POSIX
1N/A shell standard.
1N/A
1N/A25. In ksh93, cd - will output the directory that it changes
1N/A to on standard output as required by X/Open. With ksh88,
1N/A this only happened for interactive shells.
1N/A
1N/A26. As an undocumented feature of ksh-88, a leading 0 to an
1N/A assignment of an integer variable caused that variable
1N/A to be treated as unsigned. This behavior was removed
1N/A starting in ksh93p.
1N/A
1N/A27. The getopts builtin in ksh93 requires that optstring contain
1N/A a leading + to allow options to begin with a +.
1N/A
1N/A28. In emacs/gmacs mode, control-v will not display the version when
1N/A the stty lnext character is set to control-v or is unset.
1N/A The sequence escape control-v will display the shell version.
1N/A
1N/A29. In ksh88, DEBUG traps were executed. after each command. In ksh93
1N/A DEBUG traps are exeucted before each command.
1N/A
1N/A30. In ksh88, a redirection to a file name given by an empty string was
1N/A ignored. In ksh93, this is an error.
1N/AI am interested in expanding this list so please let me know if you
1N/Auncover any others.