Klammernotation beim Parameter.

This commit is contained in:
2025-06-19 06:48:16 +02:00
parent 1af089d106
commit c750cb4c69
2 changed files with 11 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
#! /usr/bin/bash
#Datei: family_case.sh
@@ -12,4 +13,7 @@ case ${1} in
'Clancy'|'Sarah'|'Ralph')
echo "Familie Wiggum"
;;
*)
echo "unbekannte Familie"
;;
esac

View File

@@ -1,9 +1,12 @@
#!/usr/bin/bash
# Datei teil23/family_if.sh
if [[ "$1" == "Homer" || "$1" == "Marge" || "$1" == "Bart" || "$1" == "Lisa" ]]; then
if [[ "${1}" == "Homer" || "${1}" == "Marge" || "${1}" == "Bart" || "${1}" == "Lisa" ]]; then
echo "Familie Simpson"
elif [[ "$1" == "Ned" || "$1" == "Maude" || "$1" == "Todd" || "$1" == "Rod" ]]; then
elif [[ "${1}" == "Ned" || "${1}" == "Maude" || "${1}" == "Todd" || "${1}" == "Rod" ]]; then
echo "Familie Flanders"
elif [[ "$1" == "Clancy" || "$1" == "Sarah" || "$1" == "Ralph" ]]; then
elif [[ "${1}" == "Clancy" || "${1}" == "Sarah" || "${1}" == "Ralph" ]]; then
echo "Familie Wiggum"
else
echo "unbekante Familie"
fi