seperate function question_answered_with_yes from /post_installation_script/Nachinstallationsarbeiten_LC_Esslingen.sh

This commit is contained in:
knightsub9
2026-06-30 15:52:44 +02:00
parent cf5de8f44e
commit 4fcfcbe06b
2 changed files with 154 additions and 152 deletions
+16
View File
@@ -0,0 +1,16 @@
# functions and variables for use in multiple files ("common" functions and variables)
question_answered_with_yes() {
local prompt="$1"
local ans
printf '%b\n Geben Sie j oder n ein und die Eingabetaste,\n Abbruch mit jeder anderen Taste ... [j/N]: ' "$prompt"
read -r ans
case "$ans" in
j | J | ja | y | Y) return 0 ;;
n | N | "") return 1 ;;
*)
echo "Abbruch."
exit 1
;;
esac
}