#!/bin/bash # case-play.sh # shell script that expects one command-line argument # and demos a Bash case statement; # updated after class to show how several options # can indeed "share" a set of actions # # by: Sharon Tuttle # last modified: 2022-11-30 case $1 in moo) echo "matched moo exactly" pwd ;; *oink*) echo "found oink in there" ;; *baa) echo "ended in baa" ;; [0-9]) echo "single-digit argument: $1" ;; # AFTER class: hey, this works!!! MOO | Moo | mOO) echo "this worked! handles MOO or Moo or mOO" ;; *) echo "None of the given cases matched" ;; esac