Switch statement with case
suggest changeWith the case statement you can match values against one variable.
The argument passed to case is expanded and matched against each pattern.
If a match is found, the commands up to ;; are executed.
case "$BASH_VERSION" in
[34]*)
echo {1..4}
;;
*)
seq -s" " 1 4
esac
Patterns are not regular expressions but shell pattern matching (aka globs).
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents