Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のシェルスクリプトを実行すると、常にどのキーに対しても「grault」として出力されます。問題は何でしょうか?
ありがとう!
#!/bin/bash declare -a MYMAP MYMAP=( [foo]=bar [baz]=quux [corge]=grault ) echo ${MYMAP[foo]} echo ${MYMAP[baz]}
で連想配列を作成します-A。
-A
declare -A MYMAP
見る:help declare
help declare