Skip to content

Instantly share code, notes, and snippets.

@antoni
Created May 16, 2017 11:54
Show Gist options
  • Select an option

  • Save antoni/cca6c4cbabc47e19a940f4a6917c8c94 to your computer and use it in GitHub Desktop.

Select an option

Save antoni/cca6c4cbabc47e19a940f4a6917c8c94 to your computer and use it in GitHub Desktop.
Hashmap in Bash
declare -A hashmap
hashmap["key"]="value"
hashmap["key2"]="value2"
echo "${hashmap["key"]}"
for key in ${!hashmap[@]}; do echo $key; done
for value in ${hashmap[@]}; do echo $value; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment