shell script循环遍历字符串数组
来源:互联网 发布:那个软件可以套花呗 编辑:程序博客网 时间:2024/05/17 23:00
遇到了, 记一下, 简单东西, 我只能说, shell script语法真TM奇葩和难记:
#!/bin/basharr=("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "e" "e" "f") for value in ${arr[@]}do echo $valuedone# 或者采取如下方式echo "----------------------another way----------------------"for (( i = 0 ; i < ${#arr[@]} ; i++ ))do echo ${arr[$i]}done
结果:
0
1
2
3
4
5
6
7
8
9
a
b
c
e
e
f
----------------------another way----------------------
0
1
2
3
4
5
6
7
8
9
a
b
c
e
e
f
阅读全文
1 0
- shell script循环遍历字符串数组
- shell怎样循环遍历字符串
- shell 脚本中for循环遍历数组
- shell script中的循环语法
- linux shell script 循环语句
- Shell循环遍历每个元素都是变量的数组
- linux shell 中数组的定义和for循环遍历
- Shell Script中FOR循环的使用
- shell script循环语法与个别注意事项
- Shell script的语法五:循环
- for 循环遍历数组
- js 数组循环遍历
- 循环遍历数组方法
- 循环遍历输出数组
- [MSSQL]循环遍历字符串
- shell 遍历数组
- shell 遍历数组
- linux shell 数组 遍历
- 拦截器
- Unity Player角色移动控制脚本实现
- spring注解方式 idea报could not autowire
- DDR工作原理
- 完美解决Error:Execution failed for task ':APP:transformClassesWithDexForDebug'...问题
- shell script循环遍历字符串数组
- JPA project Change Event Handler问题解决
- Integer.toHexString(b & 0xff)理解以及& 0xff什么意思
- vue的“$index” is undefined错误
- 【Codeforces633H】Fibonacci-ish II
- tornado 简单的web服务
- ionic select元素安卓真机上点击无效的解决方案
- button的样式在浏览器上的兼容性
- 爬虫基础 -- pyquery