Created
June 1, 2024 10:52
-
-
Save dewomser/f5852a436426c2e3812d4bd8068bbeee to your computer and use it in GitHub Desktop.
Lottoschein 6 aus 49 Tippvorschlag . Ein Bashskript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/bin/bash | |
# Erzeugen Sie eine Liste von 49 Zahlen | |
numbers=$(seq 49) | |
# Ziehen Sie 6 Zahlen und sortieren Sie sie | |
drawn_numbers=$(shuf -i 1-49 -n6 | sort -n) | |
# Erstellen Sie eine 7x7-Matrix | |
matrix=$(echo $numbers | xargs -n7) | |
# Ersetzen Sie die gezogenen Zahlen durch rote Zahlen | |
for number in $drawn_numbers | |
do | |
matrix=$(echo $matrix | sed "s/\b$number\b/$(tput setaf 1)$number$(tput sgr0)/g") | |
done | |
# Ausgabe der Matrix | |
echo "$matrix"| xargs -n7 |
Author
dewomser
commented
Jun 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment