Created
October 28, 2016 20:27
-
-
Save dokipen/fafe360656dcef1ad0a68cce019d2c27 to your computer and use it in GitHub Desktop.
Why don't fields set in the loop propagate out of the loop?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare -A testthis | |
testthis[hello]="world" | |
echo "keys: ${!testthis[@]}" | |
printf "a\nb\nc\nd\ne\nf\n" | while read key && read value; do | |
testthis[$key]="${value}" | |
echo "keys: ${!testthis[@]}" | |
done | |
echo "keys: ${!testthis[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment