Use a vertical bar (|
) for “or”.
case "$C" in
"1")
do_this()
;;
"2" | "3")
do_what_you_are_supposed_to_do()
;;
*)
do_nothing()
;;
esac
More Related Contents:
- Is there a list of ‘if’ switches anywhere?
- Using case for a range of numbers in Bash
- While loop stops reading after the first line in Bash
- Propagate all arguments in a bash shell script
- Why does “local” sweep the return code of a command?
- Renaming files in a folder to sequential numbers
- How to get Maven project version to the bash command line
- Recursively rename files using find and sed
- Batch renaming files with Bash
- How to generate random number in Bash?
- How to skip the for loop when there are no matching files?
- In bash, how do I bind a function key to a command?
- “Invalid Arithmetic Operator” when doing floating-point math in bash
- Using sed to mass rename files
- Sort a text file by line length including spaces
- List files not matching a pattern?
- How to parallelize for-loop in bash limiting number of processes
- Bash script to cd to directory with spaces in pathname
- bash variable interpolation separate variables by a hyphen or underscore
- Get the date (a day before current time) in Bash
- Bash scripting, multiple conditions in while loop
- Get exit code from subshell through the pipes
- Rename all files in directory from $filename_h to $filename_half?
- What does the curly-brace syntax ${var%.*} mean?
- Reading input files by line using read command in shell scripting skips last line
- How to undo exec > /dev/null in bash?
- How to echo a variable containing an unescaped dollar sign in bash
- Multi Level Bash Completion
- Left side of pipe is the subshell?
- How to read variables from file, with multiple variables per line?