Some time ago I posted a question (included below) about a behaviour change in
the Korn shell between Dunix 3.2 and 4.0.
Thanks to Knut Hellebx, Mike O'Brien, Ronny, Gilles Casavecchi, for their
reactions (mainly pointers to patches and suggestions to use the 3.2 ksh,
because the behaviour is considered a bug). I finally took the problem to
Digital. They say:
> Your problem is a "known" problem at engineering. It has QAR Number 49130
>
> There it says :
>
> The Digital UNIX V4.0x confirms the XPG4 standard. Then the $0 in the ksh
> scripts always gives you the filename back and not the functionname.
>
> So the behavior in Digital UNIX V3.2G was wrong.
> Why HP is not in compliance with XPG4, I don't know, ask them.
>
> Some remarks from engineering :
>
> > Digital Unix is XPG4 compliant from the Platinum release which
> > is Digital Unix 4.0.
> > I am not sure about the history of XPG4 but Digtal Unix was among
> > the first to be in compliance with these standards.
So now Digital has a Korn shell that does not behave in the way described in
the book "The new Korn shell" by Bolsky and... Korn!
Groeten, Alex Kok (Alex.Kok_at_nlzcl1.decnet.philips.nl)
========
My original question:
> A trainee of mine noted a change of behaviour in the Korn shell in Dunix 4.0.
> It concerns the way functions work with $0. I have written a small script
> I called "functienaam" illustrating the behaviour change:
>
> #!/bin/ksh
> function demo
> {
> print $0
> }
> print "Script: `whence $0`"
> print -n "Function name: "
> demo
> exit
>
> On Dunix 3.2G (and HP-UX 10), this results in the expected:
> scdw$ ./functienaam
> Script: /home/c753330/./functienaam
> Function name: demo
>
> On Dunix 4.0 and 4.0B the function does not return it's own name:
> nlasdc06.lss.cp.philips.com:sysmgr> ./functienaam
> Script: /home/sysmgr/kok/./functienaam
> Function name: ./functienaam
>
> Note the different result following "Function name:". Is this a "feature" of
> v4.0, or have I overlooked something? Or is it a bug? Or is it "Posix" perhaps?
The answers from the list:
Without knowing for sure I saw a reference to a ksh patch the other day
for Dunix 4.x maybe this'll do the trick ?
====
This is a known problem.... Take the ksh shell from a 3.2g box and put it on
your 4.0 system.
====
I am forwarding my discussion from last week regarding ksh and I got
resolve this by installing patch osf410-057 (new patch id 98.00)
====
Not posix, not a feature, a bug as others with ksh in 4.0
We still keep a copy of 3.2 ksh under /bin instead of the default one renamed
as ksh.4.0 and all our old scripts work.
We are waiting for corrections in 4.xx I guess as it already occured with the
1.2 and the 3.0a where ksh were very different.
Received on Wed Jul 16 1997 - 09:43:36 NZST