From f66f2cd36339e9017523f6f48e2c144fc69ae0dd Mon Sep 17 00:00:00 2001 From: Hugh Ratsch Date: Sun, 16 Feb 2025 07:35:46 -0600 Subject: [PATCH] updated notes --- src/rhcsa.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/rhcsa.md b/src/rhcsa.md index 8e60786..e9f696a 100644 --- a/src/rhcsa.md +++ b/src/rhcsa.md @@ -357,3 +357,34 @@ else echo "The file '$user_file' does not exist." fi ``` + +### for loop +```bash +#!/bin/bash + +for i in 1..10; do + echo $i +done +``` + +### while loop +```bash +#!/bin/bash + +i=1 +while [ $i -le 10 ]; do + echo $i + i=$((i+1)) +done +``` + +### until loop +```bash +#!/bin/bash + +i=1 +until [ $i -gt 10 ]; do + echo $i + i=$((i+1)) +done +``` \ No newline at end of file