shellScript之数组操作6
来源:互联网 发布:excel数据透视表作用 编辑:程序博客网 时间:2024/06/07 20:02
#!/bin/bashdeclare -a arrivedecho "what city have you been arrived?"echo "The input should be sperated from echo other by a space."read -a arrivedechofor i in "${arrived[@]}"do echo $idoneecho "The length of this array is ${#arrived[@]}"echo "Executing UNSET operating..."unset arrived[1]echo "The length of this array is ${#arrived[@]}"echo "Executing unset operating...."unset arrivedecho "The length of this array is ${#arrived[@]}"
结果:
~/script/shell_text $ ./11array.sh what city have you been arrived?The input should be sperated from echo other by a space.beijing handan tianjing shanghai hongkongbeijinghandantianjingshanghaihongkongThe length of this array is 5Executing UNSET operating...The length of this array is 4Executing unset operating....The length of this array is 0
阅读全文
0 0
- shellScript之数组操作6
- shellScript之数组操作1
- shellScript之数组操作2
- shellScript之数组操作3
- shellScript之数组操作4
- shellScript之数组操作5
- shellScript之数组操作7
- shellScript之位置参数
- shellScript之if_else语句
- shellScript之if_elif_else语句
- shellScript之case语句
- shellScript之for语句
- shellScript之while语句
- shellScript之while语句
- shellScript之util语句
- shellScript之break关键字
- shellScript之continue语句
- shellScript之select语句
- C/C++程序的内存分配
- shellScript之数组操作5
- Django配置Ajax跨域调用/设置Cookie
- Android---广播
- iOS BASE64 编码 和HASH 哈希函数(散列函数) ~用户信息安全
- shellScript之数组操作6
- Spark转化算子和操作算子
- 安卓练习
- 微信公众号开发 配置服务器URL,验证Token
- 如何将公式中的参数转化成数字
- linux 等待队列
- Linux Kernel gpio export功能
- 字符个数统计(C/C++)
- shellScript之数组操作7