cc: Alan.Steinberg at Sun.COM
Subject: Re: [ksh93-integration-discuss] typeset -r doesn't stay local in ksh93
--------
> A ksh script that my group has been using for a long time in Solaris
> breaks when running under ksh93 (both on Solaris and OpenSolaris). I
> traced the problem to the fact that local variables declared with
> "typeset -r" get a "varname: is read only" error when the local function
> is called multiple times. Here's the script I wrote to test it:
> ...
> So is the bug in ksh93, or is ksh being too lenient with its use of
> "typeset -r"?
>
> -- Alan
>
The problem is that since POSIX did not define local variables for
functions defined as name(), ksh93 does not support local variables
for these functions.
If you use
function name{...}, instead of name(){...} you script will
work with both ksh93 and ksh88.
David Korn
dgk at research.att.com