Case (ksh)

Isn't any "NOT" operator that can be used in the case construction like :

case $VAR (NOT) in
option1 | option2 | option 3...) COMMAND ;;
esac

Or something similiar to the "default" from switch, so I could at least do something like this:

case $VAR in

        option 1 | option 2 | option 3  ...\)           do nothing ;;
        default\) COMMAND ;;

If the answer is no,
:frowning:
I'll use a flag that is filled when VAR is one of the possible values...

  • can be the default
case $VAR in
     pattern1)
          statement 1
          ;;
     pattern2)
          statement 2
          ;;
       *)
         default statement
          ;;
esac

case ${var} in
!pattern1)
statements
;;
!pattern2)
statements
;;
*)
statements
;;
esac