Update 'bash/associative_array.bash'

This commit is contained in:
daryl
2022-07-04 09:23:11 +09:30
parent 178d7f3b21
commit a31518bc73

View File

@@ -12,8 +12,16 @@ array[repo_three]=false
# The key is accessed using the exclamation point
for i in "${!array[@]}"
do
echo "key : $i"
echo "key: $i"
if ${array[$i]}; then
echo "$i is true"
fi
done
done
# Output will be:
#
# key: repo_one
# repo_one is true
# key: repo_two
# repo_one is true
# key: repo_three