shell
HalFTeen
为了更美好的明天而战
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
shell中的比较和测试符号笔记
[ condition ] && action; #如果conditon为真,则执行acation; [ conditon ] || action; #如果condition 为假,执行action。 -eq 等于 -ne 不等于 -gt 大于 -lt 小于 -ge 大于等于 -le 小于等于 -a 与(and) -o 或(or) 文件系统相关测试: [ -f $file_var原创 2017-07-20 10:23:24 · 610 阅读 · 0 评论 -
shell普通数组和关联数组的区别
shell中的普通数组和C的一维数组一样,关联数组的区别就是 1、关联数组可以用任意的文本作为数组索引,而普通数组中的索引都是整数。 2、关联数组使用之前需要声明:$declare -A ass_arrayass_array就是关联数组的名字,定义方法有两种: 1、利用内嵌“索引-值”列表的方法:$ ass_array=([index1]=val1 [index2]=val2) 2、使用原创 2017-07-19 11:42:24 · 1513 阅读 · 0 评论
分享