Browse Source

teil22

master
Olli Graf 2 weeks ago
parent
commit
81a7c96f7f
  1. 0
      teil22/ebene0/0.txt
  2. 16
      teil23/parseargs.sh
  3. 15
      teil24/family.sh

0
teil22/ebene0/0.txt

16
teil23/parseargs.sh

@ -1,17 +1,21 @@
#!/bin/bash #!/bin/bash
display_help() {
echo "Usage: ${0} [options]"
echo "Options:"
echo " -h, --help Show this help message"
echo " -v, --verbose Enable verbose mode"
echo " -f, --file <file> Specify a file"
echo " -n, --number <num> Specify a number (default: 42)"
}
# Universelle Parameterparser-Funktion # Universelle Parameterparser-Funktion
parse_args() { parse_args() {
POSITIONAL=() POSITIONAL=()
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
-h|--help) -h|--help)
echo "Usage: $0 [options]" display_help "$@"
echo "Options:"
echo " -h, --help Show this help message"
echo " -v, --verbose Enable verbose mode"
echo " -f, --file <file> Specify a file"
echo " -n, --number <num> Specify a number (default: 42)"
exit 0 exit 0
;; ;;
-v|--verbose) -v|--verbose)

15
teil24/family.sh

@ -0,0 +1,15 @@
#! /usr/bin/bash
case ${1} in
'Homer'|'Marge'|'Bart'|'Lisa')
echo "Familie Simpson"
;;
'Ned'|'Maude'|'Todd'|'Rod')
echo "Familie Flanders"
;;
'Clancy'|'Sarah'|'Ralph')
echo "Familie Wiggum"
;;
esac
Loading…
Cancel
Save