Re: Another potential ksh bug?

2020-12-11 Thread Jordan Geoghegan

Hi Vadim,

Thanks for looking into this, all I ever wanted was an ancient pdksh bug 
fix for Christmas.


Regards,

Jordan



On 12/7/20 10:47 AM, Vadim Zhukov wrote:

For me, this is a definite bug. I've opted my students to fix this
bug, so unless there's a hurry, there must be a fix till the end of
December. :)

пн, 7 дек. 2020 г. в 07:43, Jordan Geoghegan :

Hello again,

I was playing around with ksh array syntax and its behaviour when set as
read-only. In my testing I noticed that ksh will allow you to overwrite
the first element of a read-only array. Example snippet:

#!/bin/ksh
arr[0]=val1
arr[1]=val2
readonly arr
echo "${arr[@]}"
arr=yikes
echo "${arr[@]}"

I tested a few other shells, and this bug does exists in the original
pdksh and is also present in zsh. This bug is not present in ksh93, mksh
or bash, where they abort when trying to modify the read-only array.

I don't have access to a proper ksh88 shell, but it would be nice if
someone could confirm its behaviour.

I was just hoping someone could confirm if this is intended behaviour,
or if it's a bug.

Regards,

Jordan







Re: Another potential ksh bug?

2020-12-11 Thread Jordan Geoghegan

On 12/7/20 10:14 PM, Noth wrote:


On 07/12/2020 05:41, Jordan Geoghegan wrote:

Hello again,

I was playing around with ksh array syntax and its behaviour when set 
as read-only. In my testing I noticed that ksh will allow you to 
overwrite the first element of a read-only array. Example snippet:


#!/bin/ksh
arr[0]=val1
arr[1]=val2
readonly arr
echo "${arr[@]}"
arr=yikes
echo "${arr[@]}"

I tested a few other shells, and this bug does exists in the original 
pdksh and is also present in zsh. This bug is not present in ksh93, 
mksh or bash, where they abort when trying to modify the read-only 
array.


I don't have access to a proper ksh88 shell, but it would be nice if 
someone could confirm its behaviour.


I was just hoping someone could confirm if this is intended 
behaviour, or if it's a bug.


Regards,

Jordan


Hi,

  I tries this with AMIX (UNIX SVR4 for Commodore Amiga) v2.1 which 
presumably is using ksh88 as it hasn't been updated since circa 1992 
and it does abort at the same place. Screenshot here: 
http://casper.nineinchnetworks.ch/images/kshtest.png .


Cheers,

Noth


Hi Noth,

Sorry for the late reply, I've been AFK for several days.

Thanks for testing that out and confirming ksh88's behaviour!

Regards,

Jordan



Re: Another potential ksh bug?

2020-12-07 Thread Noth



On 07/12/2020 05:41, Jordan Geoghegan wrote:

Hello again,

I was playing around with ksh array syntax and its behaviour when set 
as read-only. In my testing I noticed that ksh will allow you to 
overwrite the first element of a read-only array. Example snippet:


#!/bin/ksh
arr[0]=val1
arr[1]=val2
readonly arr
echo "${arr[@]}"
arr=yikes
echo "${arr[@]}"

I tested a few other shells, and this bug does exists in the original 
pdksh and is also present in zsh. This bug is not present in ksh93, 
mksh or bash, where they abort when trying to modify the read-only array.


I don't have access to a proper ksh88 shell, but it would be nice if 
someone could confirm its behaviour.


I was just hoping someone could confirm if this is intended behaviour, 
or if it's a bug.


Regards,

Jordan


Hi,

  I tries this with AMIX (UNIX SVR4 for Commodore Amiga) v2.1 which 
presumably is using ksh88 as it hasn't been updated since circa 1992 and 
it does abort at the same place. Screenshot here: 
http://casper.nineinchnetworks.ch/images/kshtest.png .


Cheers,

Noth



Re: Another potential ksh bug?

2020-12-07 Thread Vadim Zhukov
For me, this is a definite bug. I've opted my students to fix this
bug, so unless there's a hurry, there must be a fix till the end of
December. :)

пн, 7 дек. 2020 г. в 07:43, Jordan Geoghegan :
>
> Hello again,
>
> I was playing around with ksh array syntax and its behaviour when set as
> read-only. In my testing I noticed that ksh will allow you to overwrite
> the first element of a read-only array. Example snippet:
>
> #!/bin/ksh
> arr[0]=val1
> arr[1]=val2
> readonly arr
> echo "${arr[@]}"
> arr=yikes
> echo "${arr[@]}"
>
> I tested a few other shells, and this bug does exists in the original
> pdksh and is also present in zsh. This bug is not present in ksh93, mksh
> or bash, where they abort when trying to modify the read-only array.
>
> I don't have access to a proper ksh88 shell, but it would be nice if
> someone could confirm its behaviour.
>
> I was just hoping someone could confirm if this is intended behaviour,
> or if it's a bug.
>
> Regards,
>
> Jordan
>


-- 
  WBR,
  Vadim Zhukov



Another potential ksh bug?

2020-12-06 Thread Jordan Geoghegan

Hello again,

I was playing around with ksh array syntax and its behaviour when set as 
read-only. In my testing I noticed that ksh will allow you to overwrite 
the first element of a read-only array. Example snippet:


#!/bin/ksh
arr[0]=val1
arr[1]=val2
readonly arr
echo "${arr[@]}"
arr=yikes
echo "${arr[@]}"

I tested a few other shells, and this bug does exists in the original 
pdksh and is also present in zsh. This bug is not present in ksh93, mksh 
or bash, where they abort when trying to modify the read-only array.


I don't have access to a proper ksh88 shell, but it would be nice if 
someone could confirm its behaviour.


I was just hoping someone could confirm if this is intended behaviour, 
or if it's a bug.


Regards,

Jordan