shell数组
来源:互联网 发布:高级研修班 知乎 编辑:程序博客网 时间:2024/06/07 16:22
#!/bin/sh#创建数组arr=(9 8 7 6 5 4 3 2 1)#arr[@]和arr[*]都表示数组的字符串表示echo ${arr[*]}echo ${arr[@]}#遍历数组echo "arr:"for num in ${arr[@]}do echo $numdone#获取数组的长度用#arr_len=${#arr[*]}echo "arr_len:$arr_len"echo "arr_len:${#arr[*]}"#取数组下标,和c语言类似i=0while [[ $i -lt $arr_len ]]do echo ${arr[$i]} i=$((i + 1))done#赋值arr[3]=-4#取数组的子序列echo ${arr[*]:4:7}echo ${arr[*]:3}
阅读全文
0 0
- shell数组
- shell数组
- shell 数组
- shell数组
- shell数组
- shell 数组
- shell-------------数组
- shell 数组
- shell数组
- shell数组
- shell数组
- Shell 数组
- shell数组
- shell数组
- shell 数组
- shell数组
- shell数组
- shell 数组
- linux下查看opencv版本
- HDU 1257(最少拦截系统)
- 使用GOOGLE的QUIC
- CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr
- 客户端svn的配置
- shell数组
- GitHub版本控制使用教程
- Python字符串的encode与decode研究心得乱码问题解决方法(转)
- 第三方接入支付宝问题:nested exception is java.lang.NoClassDefFoundError: com/alipay/api/AlipayRequest
- thinkcmf 后台修改密码
- Robot Framework For Mobile Test Automation
- JVM内部架构
- 敏捷开发的三个流程
- 伽卡他卡学生端关闭