Readme.md aktualisiert.

This commit is contained in:
2025-11-21 11:22:28 +01:00
parent 815a66d808
commit 0939c771f3
13 changed files with 215 additions and 0 deletions

10
teil24/associative_array.sh Executable file
View File

@@ -0,0 +1,10 @@
#! /usr/bin/bash
declare -A family
family=([father]="Homer" [mother]="Marge" [son]="Bart" [daughter]="Lisa" [baby]="Maggie")
echo "Iterating through associative array using while loop:"
while IFS= read -r key && IFS= read -r value <&3; do
echo "Key: $key, Value: $value"
done < <(printf '%s\n' "${!family[@]}") 3< <(printf '%s\n' "${family[@]}")