Shark Deng

Interactive Designer @Shanju Design in Shanghai

touched caffe / mxnet / python / wordpress / bootstrap / Arduino / Raspberry Pi / webgl / three.js / PIXI / 3dMax

Email

Github

Mac shell数组

2019-11-18 22:22:12

1.创建数组

a=(1 2 3) # 用空格分割

a=”1 2 3″

2. 显示数组长度

${#a[@]}

3. 显示第i个元素

$a[i]

4.遍历数组

for i in ${a[@]}

do

echo “—“$i

done



——By SharkDeng
如果你喜欢我的文章,欢迎红包赞赏

Leave a Reply

Your email address will not be published. Required fields are marked *