Case statement fallthrough?

后端 未结 3 936
长情又很酷
长情又很酷 2020-12-05 03:57

In popular imperative languages, switch statements generally \"fall through\" to the next level once a case statement has been matched.

Example:

int         


        
3条回答
  •  爱一瞬间的悲伤
    2020-12-05 04:14

    Try this:

    case $VAR in
    normal)
        echo "This doesn't do fallthrough"
        ;;
    fallthrough)
        echo -n "This does "
        ;&
    somethingelse)
        echo "fall-through"
        ;;
    esac
    

提交回复
热议问题