How to use bash's "case" statement for "very specific" string patterns (multiple words, including spaces) ?
The problem is: I receive a multi-word String from a function which is pretty specific, including a version number. The version number now changes from time to time. Instead of adding more and more specific string patterns to my case statement, I would like to use a joker (or whatever the word for this is, like "Ubuntu 16.04.? LTS" or "Ubuntu 16.04.* LTS" . However, I didn't find any solution to this yet.
See this shell script I used so far:
.
.
.
case "${OS}" in
"SUSE Linux Enterprise Server 11 SP4")
echo "SLES11 detected."
;;
"Ubuntu 16.04.3 LTS" | "Ubuntu 16.04.4 LTS" )
echo "UBUNTU16 detected."
;;
"CentOS Linux 7 (Core)")
echo "CENTOS7 detected."
;;
*)
echo "Unknown OS detected. Quitting for safety reasons."
exit -1
;;
.
.
.