Skip to content

Instantly share code, notes, and snippets.

@stevekuznetsov
Created January 14, 2016 21:46
Show Gist options
  • Save stevekuznetsov/501843e95b16cbec2e44 to your computer and use it in GitHub Desktop.
Save stevekuznetsov/501843e95b16cbec2e44 to your computer and use it in GitHub Desktop.
associative array failure
#!/bin/bash
declare -o nounset
declare -A some_array
echo "${some_array[some_key]-}" # this is OK
some_array[some_other_key]=some_val # this is OK
echo "${some_array[some_key]}" # this is *not* OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment