码迷,mamicode.com
首页 > 系统相关 > 详细

shell脚本编程相关2

时间:2018-09-02 11:08:19      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:数组   16px   元素   array   取数   index   dex   nbsp   shell脚本编程   

1.shell数组的定义和读取

array_name=(A B "C" D)

${array_name[index]}  #元素下标从0开始

${my_array[*]}  #获取数组中所有元素

${my_array[@]} #获取数组中所有元素

${#my_array[*]}  #数组长度

shell脚本编程相关2

标签:数组   16px   元素   array   取数   index   dex   nbsp   shell脚本编程   

原文地址:https://www.cnblogs.com/mathyk/p/9572864.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!