Name

case

Synopsis

case string

  in

    regex)

       commands

       ;;

       ...

    esac

Description

If string matches regular expression regex, perform the following commands. Proceed down the list of regular expressions until one is found (to catch all remaining strings, use * as regex at the end).

Get Linux in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.