I've encountered counterintuitive behavior that occurs when an indexed
array contains a single compound variable, and a subvariable of the
compound variable is accessed via the syntax ARRAY[0].SUBVARIABLE:
########################################
$ typeset -T My_t=(integer i)
$ My_t x=(i=1)
$ My_t -a A=x
$ echo ${A[0]}
( typeset -l -i i=1 )
$ echo ${A.i}
1
$ echo ${A[0].i}
########################################
However, if another element is appended to the indexed array, then the
value of A[0].i can be printed as expected
########################################
$ My_t y=(i=2)
$ A+=(y)
$ echo ${A[0]}
( typeset -l -i i=1 )
$ echo ${A[0].i}
1
$ echo ${A[1].i}
2
########################################
I've tested ksh93 Version JM 93u 2011-02-08, Version AJM 93u+
2012-08-01, and Version AJM 93v- 2012-11-20.
--
Nathan Weeks
IT Specialist
USDA-ARS Corn Insects and Crop Genetics Research Unit
http://weeks.public.iastate.edu/
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users