From a38896f0af23c08486240c74beec60ad2a5e3d6b Mon Sep 17 00:00:00 2001 From: zleyyij Date: Thu, 30 May 2024 18:26:46 -0600 Subject: [PATCH] vault backup: 2024-05-30 18:26:46 --- IT/Scripting.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/IT/Scripting.md b/IT/Scripting.md index a4c9ba2..f5a52b4 100644 --- a/IT/Scripting.md +++ b/IT/Scripting.md @@ -71,6 +71,8 @@ goodbye) esac ``` +If using `tes` + ## Loops ### For loops `for` loops are used when you have a finite collection over which you want to iterate, such as a list of files, or a list of server names: @@ -86,7 +88,14 @@ for i in {1..10} ; do ... ; done ``` ### While loops `while` loops operate on lists of unknown size. It will keep running until the `test` it evaluates returns false: - +```bash +i=0 +while [ $i -lt 10 ]; do + echo $i + i=$(( $i + 1)) +done +echo “Done counting” +``` ### While loops ## Commands