Clark, AFAIK typeset -p var or typeset +v var or [[ -v var ]] should
NOT create any variables. Their sole purpose is to print attributes or
test the existence of a variable or array element, but NOT create it.

Olga

On Wed, Mar 21, 2012 at 4:53 AM, Clark J. Wang <[email protected]> wrote:
> See following example:
>
> $ echo $KSH_VERSION
> Version JMP 93u+ 2012-02-29
> $ typeset -p arr
> $ typeset -a arr=( a b )
> $ typeset -p arr
> typeset -a arr=(a b)    <== only [0] and [1] now
> $ typeset -p arr[10]
> $ echo ${!arr[@]}
> 0 1 10    <== [10] was created  by `typeset -p'
> $ typeset -p arr
> typeset -a arr=([0]=a [1]=b [10]=)
> $
>
> _______________________________________________
> ast-users mailing list
> [email protected]
> https://mailman.research.att.com/mailman/listinfo/ast-users
>



-- 
      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/     [email protected]   \-`\-'----.
 `'-..-| /       http://twitter.com/fleyta     \ |-..-'`
      /\/\     Solaris/BSD//C/C++ programmer   /\/\
      `--`                                      `--`

_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to