Update 'bash/associative_array.bash'
This commit is contained in:
@@ -12,8 +12,16 @@ array[repo_three]=false
|
|||||||
# The key is accessed using the exclamation point
|
# The key is accessed using the exclamation point
|
||||||
for i in "${!array[@]}"
|
for i in "${!array[@]}"
|
||||||
do
|
do
|
||||||
echo "key : $i"
|
echo "key: $i"
|
||||||
if ${array[$i]}; then
|
if ${array[$i]}; then
|
||||||
echo "$i is true"
|
echo "$i is true"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Output will be:
|
||||||
|
#
|
||||||
|
# key: repo_one
|
||||||
|
# repo_one is true
|
||||||
|
# key: repo_two
|
||||||
|
# repo_one is true
|
||||||
|
# key: repo_three
|
||||||
|
|||||||
Reference in New Issue
Block a user