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