Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
42
Help us understand the problem. What is going on with this article?
@ques0942

Bashで連想配列を使用する

More than 5 years have passed since last update.
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: 連想配列を他の変数に代入する方法を調べる。

42
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ques0942
基本的には自分メモ shellscriptが最近のマイブーム

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
42
Help us understand the problem. What is going on with this article?