Linux
::Bash choix aléatoire dans un tableau
[Trackback]
Date : 2008-01-08@15:01:03
Rang : 0
Voici un petit code qui permet de choisir de manière aléatoire un élément d'un tableau.
#!/bin/bash
choices=("un" "deux" "trois")
choice=${choices[$RANDOM%${#choices[*]}]}
echo "$choice"
