case (selection)

bash also provides a means of performing a series of tests on the same variable, that is to choose a case from a list and carry out the related commands.



case $1 in
 ( "toto" )
   echo toto
 ( "titi" )
   echo titi
 ( "tata" | "totoro" )
   echo zouh
 ( * )
   echo not recognised

;; stops the interpretations of the commands, while ;& allows the continuation of the reading of the script.