diff --git a/IT/Scripting.md b/IT/Scripting.md index f183f40..2d71b90 100644 --- a/IT/Scripting.md +++ b/IT/Scripting.md @@ -56,6 +56,21 @@ else fi ``` +To test one value against a variety of conditions, you can use `case`: +```bash +case "$1" in +hello|hi) + echo "hello yourself" + ;; +goodbye) + echo "nice to have met you" + echo "I hope to see you again" + ;; +*) + echo "I didn't understand that" +esac +``` + ## Commands | Command | Description | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |