Switch case with fallthrough?

前端 未结 5 901
一生所求
一生所求 2020-12-04 07:43

I am looking for the correct syntax of the switch statement with fallthrough cases in Bash (ideally case-insensitive). In PHP I would program it like:

switch         


        
5条回答
  •  自闭症患者
    2020-12-04 08:22

    Try this:

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

提交回复
热议问题