shell數組

一、普通數組關聯數組
python

(1)普通數組linux

        不須要聲明,直接賦值就能夠。以下數組

       [root@localhost ~]# array1=(james wade bosh)ide

       [root@localhost ~]# echo ${array1[@]}it

       james wade boshclass

二、關聯數組變量

     賦值以前須要先聲明關聯數組:di

    [root@localhost ~]# declare -A infoview

    再給數組賦值:vi

    [root@localhost ~]# info=([name]=flg [age]=29 [skill]=linuxpython)

    不然變量取值會不正確。

相關文章
相關標籤/搜索