Re: ksh93 'typeset -n' definition question
Thorsten Glaser <
tg@...>
2010-01-04 21:15:54 GMT
Hi again,
there's another question: why does ksh93 (at least the one
from Debian unstable) fail this with a syntax error during
'foo' dereference time?
typeset -n foo=bar[i]
bar=(b c a)
for i in 0 1 2 3; do
print $i $foo .
done
In mksh, surprisingly, this works as expected ('0 b .' etc).
On the ${%x} thing, I've now implemented it so that it will
return -1 if an ASCII, latin1 or Unicode control character
is contained, and the width (Unicode mode) or number of oc-
tets (non-Unicode mode) otherwise. Here, control character
is (in both modes) what wcwidth() returns -1 on. I think
this makes the most sense, is the most consistent and will
be easier to implement in shells that actually use wcwidth
and the OS' locale functions.
bye,
//mirabilos
--
--
«MyISAM tables -will- get corrupted eventually. This is a fact of life. »
“mysql is about as much database as ms access” – “MSSQL at least descends
from a database” “it's a rebranded SyBase” “MySQL however was born from a
flatfile and went downhill from there” – “at least jetDB doesn’t claim to
(Continue reading)