@shell腳本中數組array經常使用技巧學習實踐@

shell中數組的下標默認是從0開始的shell 1。將字符串放在數組中,獲取其長度數組 #!/bin/bash str="a b --n d" array=($str) length=${#array[@]} echo $lengthbash for ((i=0; i<$length; i++)) do echo ${array[$i]} doneoracle 執行結果:less [oracle
相關文章
相關標籤/搜索