摘要: 001、普通数组 普通数组的定义: ay=(100 200 300 "aa" "bb") ## 直接定义 [root@PC1 test]# ay2[0]=800 ## 单独定义每一个元素 [root@PC1 test]# ay2[1]="aaaa" [root@PC1 test]# ay2[2]=5 阅读全文
posted @ 2023-02-24 23:48 小鲨鱼2018 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 001、 [root@PC1 test]# ls test.sh [root@PC1 test]# cat test.sh ## 测试脚本 #!/bin/bash read -p "please input an character:" key ## 给变量key赋值 case $key in ## 阅读全文
posted @ 2023-02-24 22:52 小鲨鱼2018 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 a b c 3 d b e 7 a d e 8 z b c 4 a d e 1 [root@PC1 test]# awk '{array[$2] += $4} END 阅读全文
posted @ 2023-02-24 12:27 小鲨鱼2018 阅读(29) 评论(0) 推荐(0) 编辑