Skip to content

Instantly share code, notes, and snippets.

@dewomser
Created November 22, 2023 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dewomser/b85dcf29b1d3908d9cac4d19be187c55 to your computer and use it in GitHub Desktop.
Save dewomser/b85dcf29b1d3908d9cac4d19be187c55 to your computer and use it in GitHub Desktop.
Ausführen einzelner Bashbefehle aus einer Liste
#!/bin/bash
# Definieren Sie eine Liste von Befehlen
commands=("ponysay" "lolcat" "htop" "hollywood" "cmatrix" "figlet" "neofetch" "sl" "toilet" "bpytop" "asciiquarium" "cowsay")
# Hauptmenüschleife
while true; do
echo "Wählen Sie einen Befehl aus der Liste aus:"
select cmd in "${commands[@]}"; do
if [ -n "$cmd" ]; then
# Führen Sie den ausgewählten Befehl aus
$cmd
break
else
echo "Ungültige Auswahl. Bitte versuchen Sie es erneut."
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment