Skip to content

Instantly share code, notes, and snippets.

@dewomser
Last active June 2, 2026 04:59
Show Gist options
  • Select an option

  • Save dewomser/915957a7f3ed2d6cceca661f2301be1c to your computer and use it in GitHub Desktop.

Select an option

Save dewomser/915957a7f3ed2d6cceca661f2301be1c to your computer and use it in GitHub Desktop.
Einfaches Menue-Skript für Bash in Bash . Kommandos starten über Eingabe von Zahlen
#!/bin/bash
# Menue für Bash in Bash. Kommandos staerten mit Zahlen
# Liste von Befehlen
commands=("ls -rtl" "ssh root@xyz.aa" "htop" "history" "cmatrix" "calendar" "neofetch" "ping 192.168.1.1" "toilet" "bpytop" "asciiquarium" "cowsay lolo")
# Hauptmenüschleife
while true; do
echo "Wähle eine Nummer aus der Befehlsliste aus! Beenden mit <STRG>+c"
select cmd in "${commands[@]}"; do
if [ -n "$cmd" ]; then
# ausgewählten Befehl ausführen
$cmd
break
else
echo "Nur Nummern von 1 - ${#commands[@]} sind gültig. Bitte versuche es neu."
fi
done
done
@dewomser
Copy link
Copy Markdown
Author

Bildschirmfoto_20250420_043930

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment