when someone abandons you,it is him that gets loss because he lost someone who truly loves him but you just lost one who doesn’t love you.
定这个标题的时候还是过了一下脑子的,本来想叫它 “bash 中的数组和字典”,但是转念一想,在 bash 中,似乎并不是直接叫它们数组和字典,而是称之为 indexed arrays 和 associative arrays,所以就改成了 “bash 中的数组和数组” 了
1 | # 使用方法 |
创建
1 | # 声明 |
添加
1 | # 添加一个 |
访问
1 | $ char=(a b c q w x y z) |
遍历
1 | $ char=(a b c q w x y z) |
删除元素
1 | $ char=(a b c q w x y z) |
创建,除了使用前必须先声明,其他操作举一反三
1 | $ declare -A char |
1 | $ for i in "${char[@]}" # 遍历数组的元素 |
be yourself, everyone else is already taken.