case
Verified for current stable LTS
Case Commands
Case command syntax with verified terminal examples.
Commands
8 commands for Case
case Search
Case Command: Allow Matching Multiple Patterns
case <$ANIMAL> in <cat>) <echo "It's a cat"> ;;& <cat|dog>) <echo "It's a cat or a dog"> ;;& *) <echo "Fallback"> ;; esac case Search
Case Command: Allow Multiple Patterns
case <$ANIMAL> in <cat>) <echo "It's a cat"> ;;& <cat|dog>) <echo "It's a cat or a dog"> ;;& *) <echo "Fallback"> ;; esac case Search
Case Command: Combine Patterns With Fallback
case <$COUNTRULE> in <[wW]|words>) <wc --words README> ;; <[lL]|lines>) <wc --lines README> ;; *) <echo "what?"> ;; esac case Search
Case Command: Continue Next Patterns Commands
case <$ANIMAL> in <cat>) <echo "It's a cat"> ;& <dog>) <echo "It's either a dog or cat fell through"> ;& *) <echo "Fallback"> ;; esac case Search
Case Command: Continue To Next Patterns Commands
case <$ANIMAL> in <cat>) <echo "It's a cat"> ;& <dog>) <echo "It's either a dog or cat fell through"> ;& *) <echo "Fallback"> ;; esac case Operations
Case Command: Display Help For Case
help case case Search
Case Command: Match Variable Against String Literals
case <$COUNTRULE> in <words>) <wc --words README> ;; <lines>) <wc --lines README> ;; esac case Search
Case Command: Match Variable Against Strings
case <$COUNTRULE> in <words>) <wc --words README> ;; <lines>) <wc --lines README> ;; esac Suggest a Case Command
Submit missing workflows, corrections, or verified alternatives for this tool.
FAQ
Coverage: Focused examples for common Case workflows.
Verified version: current stable LTS.
Verification: Test commands in a disposable workspace and submit notes for edge cases.