From 3c8db1d8ffe051566e7a0a7829e160a10d0fbf95 Mon Sep 17 00:00:00 2001 From: zleyyij Date: Thu, 30 May 2024 18:17:46 -0600 Subject: [PATCH] vault backup: 2024-05-30 18:17:46 --- IT/Scripting.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |