informatique:linux:programmation_shell
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
informatique:linux:programmation_shell [2020/01/14 09:01] – [Les tableaux] Exemple de découpage d'une chaîne dans un tableau pteu | informatique:linux:programmation_shell [2020/01/14 14:58] – [Tableau associatif] pteu | ||
---|---|---|---|
Line 192: | Line 192: | ||
</ | </ | ||
+ | ====Tableau associatif==== | ||
+ | Créer et utiliser un vrai tableau associatif : | ||
+ | <code bash> | ||
+ | declare -A TA=([cle1]=valeur1 ["cle 2" | ||
+ | echo " | ||
+ | # valeur1 | ||
+ | |||
+ | # Parcourir le tableau | ||
+ | for cle in " | ||
+ | echo " | ||
+ | done | ||
+ | #cle=cle 2 ; val=valeur 2 | ||
+ | #cle=cle3 ; val=valeur3 | ||
+ | #cle=cle1 ; val=valeur1 | ||
+ | </ | ||
+ | |||
+ | Pour connaitre la taille de ce tableau : '' | ||
=====getopts : analyse des arguments d'un script===== | =====getopts : analyse des arguments d'un script===== | ||
informatique/linux/programmation_shell.txt · Last modified: 2023/10/02 13:35 by pteu