Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Use case for complicated conditional statements in bash

The basic syntax:

case $variable in
  pattern) command-list;;
esac

For example:

case "$1" in
  a) echo "a matched";;
  b) echo "b matched";;
  c)
    echo "c matched"
  ;;
esac

See extract.sh for the example script.