43
42

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Bashで連想配列を使用する

Last updated at Posted at 2014-02-26
declare -A hash_

で定義して

hash_["a"]="test"

のように使う

中身を参照するときは

echo ${hash_["a"]}

とする。

echo ${hash_}

とはできない。

キーの一覧の取得

echo ${!hash_[@]}

参考URL: http://stackoverflow.com/questions/3112687/how-to-iterate-over-associative-array-in-bash

TODO: 連想配列を他の変数に代入する方法を調べる。

43
42
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
43
42

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?