Sujet : Re: [ksh93u+m] Interactive subshell expansion disfunctional
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shellDate : 02. Jul 2024, 09:52:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v60f4o$1it1s$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
Thanks for your post, Martijn!
On 02.07.2024 05:35, Martijn Dekker wrote:
Op 22-06-2024 om 13:15 schreef Janis Papanagnou:
[...]
>
An example for the above mentioned effect shows up like that...
>
$ pushftp
pushftp: LINES.set: line 44: .kosta.rows=24: no parent
pushftp: COLUMNS.set: line 45: .kosta.cols=79: no parent
pushftp: line 11: 1: pushftp file ftp-path [ domain ]
[...]
I can't tell whether I have missed something with discipline functs
on built-in variables, how I used the namespaces, or something like
that. (My tries to fix that in my program logic all failed.) Though
the above "no parent" error messages did not show up with ksh93u+.
The fix for this is a prior 'typeset .kosta' (or even just '.kosta=') to
create the parent variable.
Adding this typeset doesn't change the observed behavior
with my test case (neither in u+ nor in u+m).
To the best of my knowledge, this is exactly the same in 93u+ 2012-08-01:
$ /bin/ksh -c 'echo ${.sh.version}; .kosta.rows=24'
Version AJM 93u+ 2012-08-01
/bin/ksh: .kosta.rows=24: no parent
A plain assignment to a namespace variable doesn't trigger
the "no parent" error in my environment.
$ /bin/ksh -c 'typeset .kosta; .kosta.rows=24; echo ${.kosta.rows}'
24
But calling any script does; two examples
(1000)$ pushftp # called in my ksh93u+m shell context
pushftp: LINES.set: line 46: .kosta.rows=24: no parent
pushftp: COLUMNS.set: line 47: .kosta.cols=80: no parent
pushftp: line 11: 1: pushftp file ftp-path [ domain ]
(1001)$ ksh93u+
(1002)$ pushftp
pushftp: line 11: 1: pushftp file ftp-path [ domain ]
(1003)$ # here I'm leaving ksh93u+ with ^D
(1003)$ pushftp # again in ksh93u+m
pushftp: LINES.set: line 46: .kosta.rows=24: no parent
pushftp: COLUMNS.set: line 47: .kosta.cols=80: no parent
pushftp: line 11: 1: pushftp file ftp-path [ domain ]
(1004)$ Version AJM 93u+m/1.0.8 2024-01-01 # Esc ^V
(1004)$ isodate # 'isodate' contains: date "+%F" "$@"
isodate: LINES.set: line 46: .kosta.rows=24: no parent
isodate: COLUMNS.set: line 47: .kosta.cols=80: no parent
2024-07-02
(1005)$ ksh93u+
(1006)$ isodate
2024-07-02
(1007)$
I have no idea why there's a difference between u+ and u+m here.
Janis