Browse Source

Klammernotation beim Parameter.

master
Olli Graf 2 weeks ago
parent
commit
c750cb4c69
  1. 4
      teil23/family_case.sh
  2. 9
      teil23/family_if.sh

4
teil23/family_case.sh

@ -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

9
teil23/family_if.sh

@ -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
Loading…
Cancel
Save