You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ksh --version
version sh (AT&T Research) 93u+m/1.0.0-beta.2 2021-12-17
I know, not the latest version so I'm terribly sorry if I report already fixed issue.
$ cat aaa
#!/usr/bin/ksh
VAR=yes
typeset -p VAR
$ chmod +x aaa
$ ksh -c 'readonly VAR=foo ; export VAR; ./aaa'
./aaa: line 1: VAR: is read only
# similarly integer variables
$ ksh -c 'typeset -i VAR=123; export VAR; ./aaa'
typeset -x -i VAR=0
I would expect the new process inherit the exported variable, but not the type of variable. The script can protect himself against integer variables by running typeset VAR=yes which is not reasonable (to me) to do for any and all variables used. I don't know if there is a way to un-readonly a variable at all.
The text was updated successfully, but these errors were encountered:
Hi, you reported this to the inactive AT&T repo and this is not where current ksh 93u+m development happens. Please upgrade to the latest release and report any bugs to https://github.com/ksh93/ksh. But yes, this issue has long since been fixed.
In the ksh 93u+m/1.0.x release series, we need to keep inheriting variable attributes through the environment for backward compatibility, but I've disabled it for readonly because scripts have no way to unset that attribute (see ksh93@7954855), and I've also disabled it for all attributes in POSIX mode, i.e., when ksh is invoked as sh (see ksh93@00d4396). In the dev branch (which will become the ksh 93u+m/1.1.x release series), this misfeature has been removed completely (see ksh93@f215b10).
I would expect the new process inherit the exported variable, but not the type of variable. The script can protect himself against integer variables by running
typeset VAR=yes
which is not reasonable (to me) to do for any and all variables used. I don't know if there is a way to un-readonly a variable at all.The text was updated successfully, but these errors were encountered: