码迷,mamicode.com
首页 > 编程语言 > 详细

shell循环字符串数组

时间:2018-09-22 21:20:25      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:i++   code   字符   another   class   数组   done   other   nbsp   

#!/bin/bash
arr=("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "e" "e" "f")

for value in ${arr[@]}
do
echo $value
done


# 或者采取如下方式
echo "----------------------another way----------------------"

for (( i = 0 ; i < ${#arr[@]} ; i++ ))
do
echo ${arr[$i]}
done

 

shell循环字符串数组

标签:i++   code   字符   another   class   数组   done   other   nbsp   

原文地址:https://www.cnblogs.com/yy123/p/9690923.html

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