Skip to content

Instantly share code, notes, and snippets.

@netmarkjp
Created March 3, 2014 07:55
Show Gist options
  • Save netmarkjp/9320323 to your computer and use it in GitHub Desktop.
Save netmarkjp/9320323 to your computer and use it in GitHub Desktop.
hash in bash
#!/bin/bash
declare -A hs
hs['key01']='val01'
hs['key02']='val02'
hs['key03']='val03'
hs['key04']='val04'
for key in ${!hs[@]}
do
echo "${key:?} => ${hs[$key]:?}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment