sh match multiple conditions in one case
Using ;;& in place of ;; causes the shell to test the next pattern list in the statement, if any, and execute any associated list on a successful match.
function cs() { case $1 in 1) echo "Mon";; 2|3|4|5) echo "Tue|Wed|Thu|Fri";; 5|6|7) # ';;&' doesn't work echo "Fri|Sat|Sun";;#& # 3) # echo "Wed";; # 2|3) # echo "Wed";; *) echo "Nothing matched";; esac echo } echo "case 1:\t$(cs 1)" echo "case 3:\t$(cs 3)" echo "case 5:\t$(cs 5)"