1. 数组
元素个数:${#array[@]}
所有元素:${array[*]}
2. 字符串
字符串长度: ${#str} - 对比数组元素个数
3. 运算
let "n=$n+1" <==> let "n++"
$(( n = $n+1 )) <==> (( n=n+1 ))
$[ n=$n+1 ] <==> n=$[ $n+1 ]
(( n++ )) <==> $[ n++ ]
Powered by: 博客园 Copyright © 2024 Chrisfang6 Powered by .NET 9.0 on Kubernetes