declare -a array=( Java Ruby Python ) echo ${array[0]} # => Java echo ${#array[*]} #=> 3(配列の要素数) for e in ${array[*]} do echo $e # => Java, Ruby, Pythonの順に出力 done for i in ${!array{*}} do echo ${array[i]} # => Java, Ruby, Pythonの順位出力 done declare -A hash=([Jack]=11 [Queen]=12 [King]=13) echo ${hash['King']} # => 13 for v in ${hash[*]} do echo $v # => Jack, Queen, King(順序は任意) done for k in ${!hash[